Trilogy - A

Gupta, Chaturvedi, and Saxena are very close friends and they are on a Goa trip. On one fine morning, all three of them went to a beach with a timer and observed the timing of the arriving sea waves. Since all three have excellent observation skills, Gupta observed that the 5th wave arrived at 178th second and then Chaturvedi observed that the 17th wave arrived at 646th second and also observed that waves followed arithmetic progression. Now they asked Saxena when will 931th wave will arrive?

Print the time when the 931st wave will arrive.

Example:

Output: 36292

Approach

C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    cout << 22 + 39 * 930 << "\n";
    return 0;
}


No comments:

Post a Comment