aboutsummaryrefslogtreecommitdiff
path: root/test.lua
blob: 3d26a408ea1f9402839698c1fb58587cae19c211 (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
-- Lua

function gcd(a, b)
    if b > 0 then
        return gcd(b, a % b);
    else
        return a;
    end
end

print("test");

N = 1000;
A = {};
for i = 1, N do
    A[i] = i - 1;
end

ans = 0;
for _, i in ipairs(A) do
    for _, j in ipairs(A) do
        ans = gcd(i, j) + ans;
    end
end
print(ans);