aboutsummaryrefslogtreecommitdiff
path: root/test.c
blob: 5a7edc46b5697e591be7f3147419454cc6045096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// C

#include <stdio.h>

inline int gcd(int a, int b)
{
    if (b > 0) return gcd(b, a % b);
    else return a;
}

int main()
{
    printf("test\n");
    
    const int N = 1000;
    int A[N];
    for (int i = 0; i < N; i++)
    {
        A[i] = i;
    }

    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < N; j++)
        {
            ans += gcd(A[i], A[j]);
        }
    }
    printf("%d\n", ans);
}