Problem Link
Problem Type : Adhoc, String Processing
Difficulty Level : Easy
Author : Imdad
Run Time: 0.289
G=0;
for(i=1;i<N;i++)
for(j=i+1;j<=N;j++)
{
G+=GCD(i,j);
}
/*Here GCD() is a function that finds the greatest common divisor of the two input numbers*/
|
25
|
24
|
23
|
22
|
21
|
10
|
11
|
12
|
13
|
20
|
9
|
8
|
7
|
14
|
19
|
2
|
3
|
6
|
15
|
18
|
1
|
4
|
5
|
16
|
17
|
1 x
2