Language: C

#
# Written by NoKnowledgeGG @YlePhan
# ('ω')
#
#import math
#mod = 10**9+7
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

""" n! mod m 階乗
mod = 1e9 + 7
N = 10000000
fac = [0] * N
def ini():
  fac[0] = 1 % mod
  for i in range(1,N):
    fac[i] = fac[i-1] * i % mod"""

"""mod = 1e9+7
N = 10000000
pw = [0] * N
def ini(c):
  pw[0] = 1 % mod
  for i in range(1,N):
    pw[i] = pw[i-1] * c % mod"""

"""
def YEILD():
  yield 'one'
  yield 'two'
  yield 'three'
generator = YEILD()
print(next(generator))
print(next(generator))
print(next(generator))
"""
"""def gcd_(a,b):
  if b == 0:#結局はc,0の最大公約数はcなのに
    return a
  return gcd_(a,a % b) # a = p * b + q"""
"""def extgcd(a,b,x,y):
  d = a
  if b!=0:
    d = extgcd(b,a%b,y,x)
    y -= (a//b) * x
    print(x,y)
  else:
    x = 1
    y = 0
  return d"""

# 最大公約数 と 最小公倍数
"""def gcd(a,b):
  if b == 0:
    return a
  return gcd(b, a % b)
def lcm(a,b):
  g = gcd(a,b)
  return (a * b) // g"""

# 二分探索
"""import bisect # 二分探索
print(A,bisect.bisect_left(A,4))
print(C,n - bisect.bisect_right(C,4))
print(sum(bisect.bisect_left(A,b) * (n-bisect.bisect_right(C,b)) for b in B))"""

# 円周率 pi
"""import math
pi_ = math.pi"""

# エラトステネスの篩
"""def Erato(n):
    prime = []
    is_prime = [True] * (n+1)
    p = 0
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2,n+1):
      if is_prime[i] == True:
        prime.append(i)
        p += 1
        for j in range(2 * i,n+1,i):
          is_prime[j] = False
    return p"""

def readInts():
  return list(map(int,input().split()))
mod = 10**9 + 7
def main():
  import math
  k = int(input())
  ans = 0
  BC = []
  for b in range(1,k+1):
    for c in range(1,k+1):
      BC.append(math.gcd(b,c))
  for a in range(1,k+1):
    for bc in BC:
      ans += math.gcd(a,bc)
  print(ans)
if __name__ == '__main__':
  main()

Compiler output:
main.c:2:3: error: invalid preprocessing directive #Written
    2 | # Written by NoKnowledgeGG @YlePhan
      |   ^~~~~~~
main.c:3:3: error: invalid preprocessing directive #(
    3 | # ('ω')
      |   ^
main.c:5:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    5 | #import math
      |  ^~~~~~
main.c:5:9: error: #import expects "FILENAME" or <FILENAME>
    5 | #import math
      |         ^~~~
main.c:6:2: error: invalid preprocessing directive #mod
    6 | #mod = 10**9+7
      |  ^~~
main.c:7:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    7 | #import itertools
      |  ^~~~~~
main.c:7:9: error: #import expects "FILENAME" or <FILENAME>
    7 | #import itertools
      |         ^~~~~~~~~
main.c:8:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    8 | #import fractions
      |  ^~~~~~
main.c:8:9: error: #import expects "FILENAME" or <FILENAME>
    8 | #import fractions
      |         ^~~~~~~~~
main.c:9:2: warning: #import is a deprecated GCC extension [-Wdeprecated]
    9 | #import numpy as np
      |  ^~~~~~
main.c:9:9: error: #import expects "FILENAME" or <FILENAME>
    9 | #import numpy as np
      |         ^~~~~
main.c:10:2: error: invalid preprocessing directive #mod
   10 | #mod = 10**4 + 7
      |  ^~~
main.c:11:1: error: expected identifier or '(' before string constant
   11 | """def kiri(n,m):
      | ^~
main.c:11:3: warning: missing terminating " character
   11 | """def kiri(n,m):
      |   ^
main.c:11:3: error: missing terminating " character
   11 | """def kiri(n,m):
      |   ^~~~~~~~~~~~~~~
main.c:18:3: warning: missing terminating " character
   18 | """ n! mod m 階乗
      |   ^
main.c:18:3: error: missing terminating " character
   18 | """ n! mod m 階乗
      |   ^~~~~~~~~~~~~~~
main.c:25:34: warning: missing terminating " character
   25 |     fac[i] = fac[i-1] * i % mod"""
      |                                  ^
main.c:25:34: error: missing terminating " character
main.c:27:3: warning: missing terminating " character
   27 | """mod = 1e9+7
      |   ^
main.c:27:3: error: missing terminating " character
   27 | """mod = 1e9+7
      |   ^~~~~~~~~~~~
main.c:33:32: warning: missing terminating " character
   33 |     pw[i] = pw[i-1] * c % mod"""
      |                                ^
main.c:33:32: error: missing terminating " character
main.c:35:3: warning: missing terminating " character
   35 | """
      |   ^
main.c:35:3: error: missing terminating " character
main.c:37:9: warning: multi-character character constant [-Wmultichar]
   37 |   yield 'one'
      |         ^~~~~
main.c:38:9: warning: multi-character character constant [-Wmultichar]
   38 |   yield 'two'
      |         ^~~~~
main.c:39:9: warning: multi-character literal with 5 characters exceeds 'int' size of 4 bytes
   39 |   yield 'three'
      |         ^~~~~~~
main.c:44:3: warning: missing terminating " character
   44 | """
      |   ^
main.c:44:3: error: missing terminating " character
main.c:45:3: warning: missing terminating " character
   45 | """def gcd_(a,b):
      |   ^
main.c:45:3: error: missing terminating " character
   45 | """def gcd_(a,b):
      |   ^~~~~~~~~~~~~~~
main.c:46:13: error: stray '#' in program
   46 |   if b == 0:#結局はc,0の最大公約数はcなのに
      |             ^
main.c:46:22: error: invalid suffix "の最大公約数はcなのに" on integer constant
   46 |   if b == 0:#結局はc,0の最大公約数はcなのに
      |                      ^~~~~~~~~~~~~~~~~~~~~~
main.c:48:24: error: stray '#' in program
   48 |   return gcd_(a,a % b) # a = p * b + q"""
      |                        ^
main.c:48:41: warning: missing terminating " character
   48 |   return gcd_(a,a % b) # a = p * b + q"""
      |                                         ^
main.c:48:41: error: missing terminating " character
main.c:49:3: warning: missing terminating " character
   49 | """def extgcd(a,b,x,y):
      |   ^
main.c:49:3: error: missing terminating " character
   49 | """def extgcd(a,b,x,y):
      |   ^~~~~~~~~~~~~~~~~~~~~
main.c:58:13: warning: missing terminating " character
   58 |   return d"""
      |             ^
main.c:58:13: error: missing terminating " character
main.c:60:3: error: invalid preprocessing directive #\U00006700\U00005927\U0000516c\U00007d04\U00006570
   60 | # 最大公約数 と 最小公倍数
      |   ^~~~~~~~~~
main.c:61:3: warning: missing terminating " character
   61 | """def gcd(a,b):
      |   ^
main.c:61:3: error: missing terminating " character
   61 | """def gcd(a,b):
      |   ^~~~~~~~~~~~~~
main.c:69:3: error: invalid preprocessing directive #\U00004e8c\U00005206\U000063a2\U00007d22
   69 | # 二分探索
      |   ^~~~~~~~
main.c:70:3: warning: missing terminating " character
   70 | """import bisect # 二分探索
      |   ^
main.c:70:3: error: missing terminating " character
   70 | """import bisect # 二分探索
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~
main.c:73:80: warning: missing terminating " character
   73 | print(sum(bisect.bisect_left(A,b) * (n-bisect.bisect_right(C,b)) for b in B))"""
      |                                                                                ^
main.c:73:80: error: missing terminating " character
main.c:75:3: error: invalid preprocessing directive #\U00005186\U00005468\U00007387
   75 | # 円周率 pi
      |   ^~~~~~
main.c:76:3: warning: missing terminating " character
   76 | """import math
      |   ^
main.c:76:3: error: missing terminating " character
   76 | """import math
      |   ^~~~~~~~~~~~
main.c:77:16: warning: missing terminating " character
   77 | pi_ = math.pi"""
      |                ^
main.c:77:16: error: missing terminating " character
main.c:79:3: error: invalid preprocessing directive #\U000030a8\U000030e9\U000030c8\U000030b9\U000030c6\U000030cd\U000030b9\U0000306e\U00007be9
   79 | # エラトステネスの篩
      |   ^~~~~~~~~~~~~~~~~~
main.c:80:3: warning: missing terminating " character
   80 | """def Erato(n):
      |   ^
main.c:80:3: error: missing terminating " character
   80 | """def Erato(n):
      |   ^~~~~~~~~~~~~~
main.c:92:15: warning: missing terminating " character
   92 |     return p"""
      |               ^
main.c:92:15: error: missing terminating " character
main.c:109:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
  109 | if __name__ == '__main__':
      |                ^~~~~~~~~~