Problem:


Score : 200 points

Problem Statement

Takahashi is standing on a two-dimensional plane, facing north. Find the minimum positive integer K such that Takahashi will be at the starting position again after he does the following action K times:

Go one meter in the direction he is facing. Then, turn X degrees counter-clockwise.

Constraints

1 \leq X \leq 179

X is an integer.

Input

Input is given from Standard Input in the following format:

X

Output

Print the number of times Takahashi will do the action before he is at the starting position again.

Sample Input 1

90

Sample Output 1

4

Takahashi's path is a square.

Sample Input 2

1

Sample Output 2

360



Sample input:
90


Sample output:
4

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    x = int(readline())

    for i in range(1, 361):
        if (x * i) % 360 == 0:
            return print(i)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def GCD(a: int, b: int) -> int:
    return a if b == 0 else GCD(b, a % b)


def LCM(a: int, b: int) -> int:
    return a * b // GCD(a, b)


x = int(input())
ans = LCM(x, 360) // x
print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random,resource

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    x = I()

    g = math.gcd(x, 360)

    return 360 // g


print(main())

Submission status: Accepted

Solution code:
N=int(input())
import math
print(360//math.gcd(360,N))

Submission status: Accepted

Solution code:
n = int(input())
if 360%n:
    print(360//(360%n)*(360//n))
else:
    print(360//n)

Submission status: Accepted

Solution code:
X = int(input())
P = 360
ans = 1
x = X
while x%P != 0:
    ans += 1
    x += X
print(ans)

Submission status: Accepted

Solution code:
x=int(input())
i=0
ans=0
while(True):
    i+=x
    ans+=1
    if(i%360==0):
        print(ans)
        break

Submission status: Accepted

Solution code:
X = int(input())
cnt = 1
deg = X
while deg%360!=0:
    deg += X 
    cnt += 1
print(cnt)

Submission status: Accepted

Solution code:
X = int(input())
i = 1
while True:
    if (X * i) % 360 == 0:
        break
    i += 1
print(i)

Submission status: Accepted

Solution code:
N = int(input())
pi = 360
while True:
  if pi % N == 0:
    print(pi//N)
    exit()
  else:
    pi+=360

Submission status: Accepted

Solution code:
X = int(input())
tmp = 360
while True:
    if tmp % X == 0:
        print(tmp//X)
        exit()
    else:
        tmp+= 360

Submission status: Accepted

Solution code:
x = int(input())
i = 1
while (360 * i) % x != 0:
  i += 1
ans = (360 * i) // x
print(ans)

Submission status: Accepted

Solution code:
import math
print(int(360 / math.gcd(int(input()), 360)))

Submission status: Accepted

Solution code:
import math

def lcm(a, b):
    return int(a * b / math.gcd(a, b))

X = int(input())
print(int(lcm(X, 360) / X))

Submission status: Accepted

Solution code:
# import matplotlib.pyplot as plt
import math
 
def lcm(x, y):
   if x > y:
       z = x
   else:
       z = y
 
   while(True):
       if((z % x == 0) and (z % y == 0)):
           lcm = z
           break
       z += 1
 
   return lcm

X = int(input())
print(int(lcm(X, 360) / X))

Submission status: Accepted

Solution code:
# import matplotlib.pyplot as plt
import math

def squaredDistance(a, b):
  return (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2

# for X in range(1, 180):
angle = 90
X = int(input())
iter = 0
current = [0, 0]
previous = current

while (iter == 0 or squaredDistance(current, [0, 0]) > 0.00001):
  if (iter > 500):
    break

  dir = [math.cos(math.radians(angle)), math.sin(math.radians(angle))]
  current = [current[0] + dir[0], current[1] + dir[1]]
  angle = (angle + X) % 360
  # plt.plot([previous[0], current[0]], [previous[1], current[1]])
  previous = current
  iter = iter + 1

  # plt.show()

print(iter)
  # print("X = {} : {}".format(X, iter))

Submission status: Accepted

Solution code:
import math
x=int(input())
if 360%x==0:
    print(360//x)
else:
    print(360 // math.gcd(x, 360))

Submission status: Accepted

Solution code:
x=int(input(""))
import math
a=math.gcd(360,x)
print(int(360/a))

Submission status: Accepted

Solution code:
x = int(input())
b = x
t = 1
 
while b % 360 != 0:
    b += x
    t += 1
 
print(t)

Submission status: Accepted

Solution code:
x = int(input())
b = x
t = 1

while b % 360 != 0:
    b += x
    t += 1

print(t)

Submission status: Accepted

Solution code:
x = int(input())
i = 1
val = x
while val % 360 != 0:
  val += x
  i += 1
print(i)

Submission status: Accepted

Solution code:
n=int(input())
k=1
while k>0:
  if k*n%360==0:
       print(k)
       break
  else:
       k+=1

Submission status: Accepted

Solution code:
n=int(input())
for i in range(1,361):
  if n*i%360==0:
    ans=i
    break
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
from math import gcd
m=gcd(360,n)
print(360//m)

Submission status: Accepted

Solution code:
x = int(input())
c = 0
n = x
while(True):
    if n%360 == 0:
        c+=1
        break
    c+=1
    n+=x
print(c)

Submission status: Accepted

Solution code:
import sys
X = int(input())

for i in range(1,180):
  if int(360*i/X) == 360*i/X:
    print(int(360*i/X))
    sys.exit()

Submission status: Accepted

Solution code:
X = int(input())

ans = 1

while (X*ans)%360 != 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
def lcm(a, b):
    from math import gcd
    return a * b // gcd(a, b) 
print(lcm(360, n := int(input())) // n)

Submission status: Accepted

Solution code:
import fractions
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
x=int(input())
y=lcm(x,360)
print(y//x)

Submission status: Accepted

Solution code:
import math

if __name__ == "__main__":
    deg = int(input())
    print(360//math.gcd(deg, 360))

Submission status: Accepted

Solution code:
x=int(input())
from math import gcd
x=gcd(x,360)
print(360//x)

Submission status: Accepted

Solution code:
X = int(input())
K = 1
while True:
    if X*K %360 ==0:
        print(K)
        break
    K += 1

Submission status: Accepted

Solution code:
x = int(input())
import numpy as np
print(np.lcm(x, 360) // x)

Submission status: Accepted

Solution code:
# do simulation

X = int(input())
Y, K = 0, 0
while True:
  Y += X
  K += 1
  if Y % 360 == 0:
    print(K)
    exit()

Submission status: Accepted

Solution code:
def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
 
 
 
num1 = int(input())
a=lcm(num1,360)
b=a/num1
print(int(b))

Submission status: Accepted

Solution code:
import math
x = int(input())
print(360//math.gcd(360, x))

Submission status: Accepted

Solution code:
from math import gcd
X = int(input())
print(360 // gcd(360, X))

Submission status: Accepted

Solution code:
x = int(input())
for i in range(1, 361):
    if i*x%360==0:
        print(i)
        break

Submission status: Accepted

Solution code:
X = int(input())
ROTATION = 360

K = 1
while K * X % 360 != 0:
    K += 1

print(K)

Submission status: Accepted

Solution code:
x = int(input())
for i in range(1,1000):
  if (360*i)%x == 0:
    print((360*i)//x)
    exit()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math

x = int(input())
ans = 360//math.gcd(360, x)
print(ans)

Submission status: Accepted

Solution code:
x=int(input())

for i in range(1,100000):
  if 360*i%x==0:
    print((i*360)//x)
    break

Submission status: Accepted

Solution code:
x = int(input())
y = 0
k = 0
while True:
    y += x
    k += 1
    if y % 360 == 0:
        break
print(k)

Submission status: Accepted

Solution code:
from math import gcd

x = int(input())
y = x * 360 // gcd(x, 360)
print(y//x)

Submission status: Accepted

Solution code:
import math
import sys

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    X = int(input())

    lcm = X * 360 // math.gcd(X, 360)
    ans = lcm // X
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import numpy as np

import math

import collections

if __name__ == '__main__':
    n = int(input())
    print(int(np.lcm(360,n)/n))

Submission status: Accepted

Solution code:
import sys
import itertools
# import numpy as np
import time
import math
import heapq
from collections import defaultdict
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

# map(int, input().split())

MOD = 10 ** 4 + 7

N = int(input())
k = 1
while True:
    if N * k % 360 == 0:
        print(k)
        break
    k += 1

Submission status: Accepted

Solution code:
# coding:utf-8
x = int(input())
r = 0
for k in range(360):
    r += x
    if r % 360 == 0:
        break
print(k + 1)

Submission status: Accepted

Solution code:
def solve(x):
    k = 1
    while k*x % 360 != 0:
        k += 1
    return k

x = int(input())
print(solve(x))

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    from math import gcd
    input = sys.stdin.readline

    x = int(input())
    print(360 // gcd(360, x))
    

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
dir = int(input())
x = 360
ans = 0

while x != 0:
  if x < 360:
    x += 360
  ans = ans + (x // dir)
  x = x % dir

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

k = 0
for i in range(360):
    k += X
    if k % 360 == 0:
        print(i+1)
        break

Submission status: Accepted

Solution code:
import math
print(360//math.gcd(360,int(input())))

Submission status: Accepted

Solution code:
import math
x = int(input())
print(360 // math.gcd(360, x))

Submission status: Accepted

Solution code:
X = int(input())

wk = 0
cnt = 0
while True:
  wk += X
  cnt += 1
  wk %= 360
  if wk % 360 == 0:
    break
  
print(cnt)

Submission status: Accepted

Solution code:
X = int(input())

k = 1
while True:
    if (X*k) % 360 == 0:
        print(k)
        break
    k += 1

Submission status: Accepted

Solution code:
def gcd(a, b):
    while b:
        a, b = b, a%b
    return a

def lcm(a, b):
    return a*b//gcd(a, b)

X = int(input())
print(lcm(360, X)//X)

Submission status: Accepted

Solution code:
X = int(input())
cnt = 1
t = X
while t % 360 != 0:
    t += X
    cnt += 1

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(1,361):
    if n*i%360 == 0:
        print(i)
        break

Submission status: Accepted

Solution code:
from math import gcd
x=int(input())
print(360//gcd(360,x))

Submission status: Accepted

Solution code:
x = int(input())
for i in range(1, 100000):
  if x * i % 360 == 0:
    print(i)
    exit()

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
X = I()
lcm = 360 * X // gcd(360,X)
print(lcm//X)

Submission status: Accepted

Solution code:
x = int(input())
#import fractions
import math
from functools import reduce
def lcm_base(x, y):
  #return (x * y) // fractions.gcd(x, y)
  return (x * y) // math.gcd(x, y)

l = lcm_base(x, 360)
print(l//x)

Submission status: Accepted

Solution code:
X = int(input())
import math
ans = 360 // math.gcd(X, 360)
print(ans)

Submission status: Accepted

Solution code:
import sys
from fractions import gcd

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()
debug = lambda *a, **kw: print("\033[33m", *a, "\033[0m", **dict(file=sys.stderr, **kw))


X = ini()


def solve():
    y = gcd(360, X)
    return 360 // y


print(solve())

Submission status: Accepted

Solution code:
x = int(input())

for i in range(360):
    if x*(i+1) % 360 == 0:
        print(i+1)
        exit()

Submission status: Accepted

Solution code:
from math import gcd

X = int(input())

print(360//gcd(X,360))

Submission status: Accepted

Solution code:
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    return gcd(b, a % b)


def main():
    X = int(input())
    ans = 360 // gcd(X, 360)
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x=int(input())
import math
K=360//math.gcd(x,360)
print(K)

Submission status: Accepted

Solution code:
from fractions import gcd
X = int(input())
print(int(360/gcd(X, 360)))

Submission status: Accepted

Solution code:
X = int(input())


def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd(a, b)


print(lcm(X, 360) // X)

Submission status: Accepted

Solution code:
cnt=0
radi=0
x=int(input())
while True:
  cnt+=1
  radi+=x
  radi%=360
  if radi==0:
    print(cnt)
    break

Submission status: Accepted

Solution code:
# A - Takahashikun, The Strider
x = int(input())
i = 1

while True:
  if 360 * i % x == 0:
    print(360 * i // x)
    break
  else:
    i += 1

Submission status: Accepted

Solution code:
def gcd(a,b):
    for i in range(1,min(a,b)+1):
        if a%i ==0 and b % i ==0:
            ans = i
    return ans

x =int(input())
print(360//gcd(360,x))

Submission status: Accepted

Solution code:
import math

n = int(input())
print(360 // math.gcd(360, n))

Submission status: Accepted

Solution code:
x = int(input())
import math
print(360*x//math.gcd(360,x)//x)

Submission status: Accepted

Solution code:
import math
x = int(input())
s =  x * 360 / math.gcd(x, 360)
print(int(s//x))

Submission status: Accepted

Solution code:
from sys import stdin
x = int(stdin.readline().rstrip())

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a
def lcm(a, b):
  return a * b // gcd(a, b)

ans = int(lcm(x, 360) / x)
print(ans)

Submission status: Accepted

Solution code:
x = int(input())
i = x
count = 1
while True:
    if i % 360 == 0:
        print(count)
        exit()
    i += x
    count += 1

Submission status: Accepted

Solution code:
from math import gcd
X = int(input())

lcm = 360 * X // gcd(360,X)
print(lcm//X)

Submission status: Accepted

Solution code:
import sys
x = int(input())
ans = 2
while(True):
    if x*ans % 360 == 0:
        print(ans)
        sys.exit()
    ans +=1

Submission status: Accepted

Solution code:
import sys 
import collections

X = int(input())

Angle = 360
for i in range(1,10**9):

    if Angle < (X*i):
        Angle = Angle + 360 

    if (Angle / (X*i)) == 1:
        print(i)
        sys.exit()

Submission status: Accepted

Solution code:
import math

x = int(input())
y = 360

lcm = x * y // math.gcd(x, y)
print(lcm//x)

Submission status: Accepted

Solution code:
x=int(input())
ans=1
while True:
  if x*ans%360==0:
    print(ans)
    break
  else:
    ans=ans+1

Submission status: Accepted

Solution code:
x = int(input())
k = 1
while (x*k)%360 != 0:
  k+=1
print(k)

Submission status: Accepted

Solution code:
x = int(input())

for i in range(1, 360 + 1):
    if i * x % 360 == 0:
        print(i)
        exit(0)

Submission status: Accepted

Solution code:
import math
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)

MOD = 10 ** 9 + 7
INF = float("inf")


def main():
    X = int(input())
    a = math.gcd(X, 360)
    a = X * 360 // a
    print(a // X)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
x = int(input())
for i in range(360):
    k = i + 1
    if x * k % 360 == 0:
        print(k)
        exit()

Submission status: Accepted

Solution code:
# for i in range(m):
# for i in range(int(input())):
#n,k= map(int, input().split())
#for _ in range(int(input())):
    #n,k= map(int, input().split())
#from collections import Counter
n=int(input())
if n%360==0:
    print(0)
    exit()
else:
    var=1
    while (var*n)%360!=0:
        var+=1
    print(var)

Submission status: Accepted

Solution code:
from math import *


def f(deg):
  di = radians(90)
  turn = radians(deg)
  i = 1
  x = 0
  y = 1
  while not done(x, y):
    di += turn
    i += 1
    y += sin(di)
    x += cos(di)
    # print(x, y, i, di)
  return i


def done(x, y):
  return abs(x - 0) < 0.00001 and abs(y - 0) < 0.00001

print(f(int(input())))

Submission status: Accepted

Solution code:
X = int(input())

for i in range(1,361):
    if (i*X) % 360 == 0:
        print(i)
        break

Submission status: Accepted

Solution code:
X=int(input())
i=1
while i*X % 360 != 0:
	i+=1
print(i)

Submission status: Accepted

Solution code:
x = int(input())
j = 0
for i in range(360):
  j += x
  j %= 360
  if j == 0:
    print(i+1)
    exit()

Submission status: Accepted

Solution code:
x = int(input())

ans = 0
tmp = 0
while True:
    ans += 1
    tmp += x
    if tmp % 360 == 0:
        break
print(ans)

Submission status: Accepted

Solution code:
import math

X = int(input())
print(360//math.gcd(X, 360))

Submission status: Accepted

Solution code:

import math
n = int(input())

circle = n * 360 // math.gcd(360,n)

print(circle // n)

Submission status: Accepted

Solution code:
from sys import stdin, setrecursionlimit
input = stdin.buffer.readline
setrecursionlimit(10 ** 7)

from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi, radians, sin, cos

MOD = 10 ** 9 + 7
INF = 10 ** 18

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)

X = int(input())
#S = input()
#N, M = map(int, input().split())
#A = list(map(int, input().split()))
#A = [int(input()) for _ in range(N)]
#ABC = [list(map(int, input().split())) for _ in range(N)]

print(lcm(X, 360) // X)

Submission status: Accepted

Solution code:
from math import gcd
def lcm(a,b):
    return a//gcd(a,b)*b
x=int(input())
print(lcm(360,x)//x)

Submission status: Accepted

Solution code:
X = int(input())
ret = 0
cur = 0
while True:
    ret += 1
    cur += X
    if cur % 360 == 0:
        print(ret)
        break

Submission status: Accepted

Solution code:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def lcm(a, b):
    return a * b // gcd(a, b)

x = int(input())
ans = lcm(x, 360) // x
print(ans)

Submission status: Accepted

Solution code:
import sys
import math


def main(X=None):
    """
    >>> main(90)
    4
    >>> main(120)
    3
    >>> main(45)
    8
    >>> main(1)
    360
    >>> main(70)
    36
    """
    if not X:
        X = int(input())
    # q, r = divmod(360, X)
    # if r == 0:
    #     print(q)
    # ret = q
    # q, r = (X, r)
    # if r == 0:
    #     ret = ret * q + 1
    ret = 0
    cur = 0
    while True:
        ret += 1
        cur += X
        if cur % 360 == 0:
            print(ret)
            return


def _test():
    import doctest
    doctest.testmod()


USE_NUMBA = False
if USE_NUMBA and sys.argv[-1] == 'ONLINE_JUDGE' or sys.argv[-1] == '-c':
    print("compiling")
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'void(i8,i8)')(main)
    # b1: bool, i4: int32, i8: int64, double: f8, [:], [:, :]
    cc.compile()
    exit()
else:
    if USE_NUMBA and sys.argv[-1] != '-p':
        # -p: pure python mode
        # if not -p, import compiled module
        from my_module import main  # pylint: disable=all
    elif sys.argv[-1] == "-t":
        _test()
        sys.exit()
    elif len(sys.argv) == 2:
        # input given as file
        input_as_file = open(sys.argv[1])
        input = input_as_file.buffer.readline

    # read parameter
    main()

Submission status: Accepted

Solution code:
from math import gcd
x = int(input())
# kx が 360 度になるような最小の k が答え
k = x * 360 // gcd(x, 360)
print(k // x)

Submission status: Accepted

Solution code:
import sys
X = int(input())
for i in range(1,1000):
  if 360*i % X == 0:
    print(360*i//X)
    sys.exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x = int(input())
ans = x
ans2 = 0

print
for i in range(1, 1000):
    temp = ans * i
    if temp % 360 == 0:
        ans2 = i
        break

print(ans2)

Submission status: Accepted

Solution code:
import math
X = int(input())
g = math.gcd(360, X)
print(360//g)

Submission status: Accepted

Solution code:
def g(a,b):
    if a*b:
        if a>b:
            return g(a-b,b)
        elif(a<b):
            return g(a,b-a)
        else:
            return a
    else:
        if(a*b):
            return max(a,b)
        else:
            return 1
n=int(input())
print(360//g(n,360))

Submission status: Accepted

Solution code:
X = int(input())
i = 1
while (360 * i) % X != 0: i += 1
print((360 * i) // X)

Submission status: Accepted

Solution code:
X = int(input())
cnt = 1
while True:
    tmp = X * cnt
    m, d = divmod(tmp, 360)
    if m >= 1 and d == 0:
        print(cnt)
        exit()
    cnt += 1

Submission status: Accepted

Solution code:
x=int(input())
for i in range(1,200):
  i*=360
  if(i%x==0):
    print(i//x)
    exit()

Submission status: Accepted

Solution code:
import math
X=int(input())
print(360//math.gcd(X,360))

Submission status: Accepted

Solution code:
X = int(input())

x = 360
while True:
    if x % X == 0:
        print (x // X)
        break
    x += 360

Submission status: Accepted

Solution code:
import math
X = int(input())

i = 1
while True:
    net = (i * X)/360
    if math.floor(net) == math.ceil(net):
        break
    else:
        i+=1
print(i)

Submission status: Accepted

Solution code:
import math
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
x = int(input())
lcm = lcm_base(360, x)
print(lcm//x)

Submission status: Accepted

Solution code:
import math
n=int(input())
print(int(360/math.gcd(n,360)))

Submission status: Accepted

Solution code:
import math

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    X = ii()
    for i in range(1, 361):
        if (X*i)%360==0:
            print(i)
            return

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
X = int(input())
lcm = X * 360 // math.gcd(X,360)
print(lcm//X)

Submission status: Accepted

Solution code:
import math

n = int(input())

cnt = 0
x = 0
y = 0
r = 0

while True:
    cnt += 1
    x += round(math.cos(math.radians(r)), 6)
    y += round(math.sin(math.radians(r)), 6)
    r += n
    
    if x <= 0.00000001 and y <= 0.00000001:
        break

print(cnt)

Submission status: Accepted

Solution code:
x = int(input())
k = 1
while k*x%360:
    k += 1

print(k)

Submission status: Accepted

Solution code:
from math import gcd
X = int(input())
print(360 // gcd(X, 360))

Submission status: Accepted

Solution code:
X=int(input())
Y =360
while 1:
	if Y % X == 0:
		print(Y//X)
		break
	else:
		Y += 360

Submission status: Accepted

Solution code:
x = int(input())
dum = 360-x
ans = dum
for i in range(360):
    if ans%360 == 0:
        break
    ans += dum
print(i+1)

Submission status: Accepted

Solution code:
X = int(input())
import math
ans = 360 // math.gcd(360, X)
print(ans)

Submission status: Accepted

Solution code:
X=int(input())
cnt=0
for i in range(1,10**7):
    cnt+=X
    if cnt%360==0:
        print(i)
        break

Submission status: Accepted

Solution code:
x = int(input())

for i in range(1, 10**5):
    if 360 * i % x == 0:
        print(360 * i // x)
        break

Submission status: Accepted

Solution code:
n=int(input())
k=1
while((k*n)%360!=0):
  k+=1
print(k)
#We can now regard Takahashi’s move as movingXdegrees on the circle,
#so the answer is the minimumksuch thatkXis a multiple of 360

Submission status: Accepted

Solution code:
n=int(input())
#n*k1=(360)*k2
#(k1/k2)=(360/n)
k=1
while((k*n)%360!=0):
  k+=1
print(k)

Submission status: Accepted

Solution code:
import sys
import math
import numpy as np
import functools
import operator
import collections
import itertools

X=int(input())
ans=1
for i in range(1,100000):
    if (X*i)%360==0:
        print(ans)
        sys.exit()
    ans+=1

Submission status: Accepted

Solution code:
x = int(input())


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    return a*(b//gcd(a, b))


print(lcm(360, x)//x)

Submission status: Accepted

Solution code:
x = int(input())


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)

  
n = gcd(x, 360)
print(360//n)

Submission status: Accepted

Solution code:
x = int(input())
k = 2
while k*x%360!=0:
    k += 1
print(k)

Submission status: Accepted

Solution code:
x = int(input())

for k in range(1, 10000):
    if x*k % 360 == 0:
        print(k)
        break

Submission status: Accepted

Solution code:
X = int(input())
i = 0
Y = X
while Y % 360 != 0:
  Y += X
  i += 1

i += 1  
print(i)

Submission status: Accepted

Solution code:
n = int(input())
ans = 360 / n
i = 1
while int(ans * i) != ans * i:
  i += 1
print(int(ans * i))

Submission status: Accepted

Solution code:
x = int(input())

k = 1
while True:
    if k*x % 360 ==0:
        print(k)
        exit(0)
    k += 1

Submission status: Accepted

Solution code:
def gcd(a,b):
	a,b=max(a,b),min(a,b)
	return a if b==0 else gcd(b,a%b)
x=int(input())
g=gcd(360,x)
print(360//g)

Submission status: Accepted

Solution code:
import math
n = int(input())
print(360 // math.gcd(n, 360))

Submission status: Accepted

Solution code:
 
# from math import factorial as fac
from collections import defaultdict
# from copy import deepcopy
import sys, math
f = None
try:
	f = open('q1.input', 'r')
except IOError:
	f = sys.stdin
if 'xrange' in dir(__builtins__):
	range = xrange
# print(f.readline())
sys.setrecursionlimit(10**2)

	
def print_case_iterable(case_num, iterable):
	print("Case #{}: {}".format(case_num," ".join(map(str,iterable))))

def print_case_number(case_num, iterable):
	print("Case #{}: {}".format(case_num,iterable))

def print_iterable(A):
	print (' '.join(A))

def read_int():
	return int(f.readline().strip())
def read_int_array():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def read_string():
	return list(f.readline().strip())
def ri():
	return int(f.readline().strip())
def ria():
	return [int(x) for x in f.readline().strip().split(" ")]
def rns():
	a =  [x for x in f.readline().split(" ")]
	return int(a[0]), a[1].strip()
def rs():
	return list(f.readline().strip())
def bi(x):
	return bin(x)[2:]





from collections import deque
import math
NUMBER = 10**9 + 7
# NUMBER = 998244353
def factorial(n) : 
	M = NUMBER
	f = 1
  
	for i in range(1, n + 1):  
		f = (f * i) % M # Now f never can  
						# exceed 10^9+7  
	return f
def mult(a,b):
	return (a * b) % NUMBER

def minus(a , b):
	return (a - b) % NUMBER

def plus(a , b):
	return (a + b) % NUMBER

def egcd(a, b):
	if a == 0:
		return (b, 0, 1)
	else:
		g, y, x = egcd(b % a, a)
		return (g, x - (b // a) * y, y)

def modinv(a):
	m = NUMBER
	g, x, y = egcd(a, m)
	if g != 1:
		raise Exception('modular inverse does not exist')
	else:
		return x % m
def choose(n,k):
	if n < k:
		assert false
	return  mult(factorial(n), modinv(mult(factorial(k),factorial(n-k)))) % NUMBER
from collections import deque, defaultdict 
import heapq


from types import GeneratorType
def bootstrap(f, stack=[]):
	def wrappedfunc(*args, **kwargs):
		if stack:
			return f(*args, **kwargs)
		else:
			to = f(*args, **kwargs)
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						break
					to = stack[-1].send(to)
			return to

	return wrappedfunc


def dfs(g, timeIn, timeOut,depths,parents): 
	# assign In-time to node u 
	cnt = 0
	# node, neig_i, parent, depth
	stack = [[1,0,0,0]]
	while stack:
		v,neig_i,parent,depth = stack[-1]
		parents[v] = parent
		depths[v] = depth
		# print (v)
		if neig_i == 0:
			timeIn[v] = cnt    
			cnt+=1
		while neig_i < len(g[v]):
			u = g[v][neig_i]
			if u == parent:
				neig_i+=1
				continue
			stack[-1][1] = neig_i + 1
			stack.append([u,0,v,depth+1])
			break
		if neig_i == len(g[v]):
			stack.pop()
			timeOut[v] = cnt
			cnt += 1
  
# def isAncestor(u: int, v: int, timeIn: list, timeOut: list) -> str: 
# 	return timeIn[u] <= timeIn[v] and timeOut[v] <= timeOut[u] 

cnt = 0
@bootstrap
def dfs(v,adj,timeIn, timeOut,depths,parents,parent=0,depth=0):
	global cnt
	parents[v] = parent
	depths[v] = depth
	timeIn[v] = cnt
	cnt+=1
	for u in adj[v]:
		if u == parent:
			continue
		yield dfs(u,adj,timeIn,timeOut,depths,parents,v,depth+1)
	timeOut[v] = cnt
	cnt+=1
	yield 

def gcd(a,b): 
    if a == 0: 
        return b 
    return gcd(b % a, a) 
  
# Function to return LCM of two numbers 
def lcm(a,b): 
    return (a*b) / gcd(a,b) 
def solution(n):
	return int(round(lcm(n,360)//n))
	
def main():
	T = 1
	# T = ri()
	for i in range(T):
		n = ri()
		# s = rs()
		# a = ria()
		# n,k = ria()
		# a=ria()

		x = solution(n)
		if 'xrange' not in dir(__builtins__):
			print(x)
		else:
			print >>output,str(x)# "Case #"+str(i+1)+':',
	if 'xrange' in dir(__builtins__):
		print(output.getvalue())
		output.close()

if 'xrange' in dir(__builtins__):
	import cStringIO
	output = cStringIO.StringIO()
#example usage:
#    for l in res:
#       print >>output, str(len(l)) + ' ' +  ' '.join(l)

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
from math import *

a = int(input())
t = gcd(360, a)
print(360//t)

Submission status: Accepted

Solution code:
x = int(input())
k = 0
while True:
  k += 1
  if (x * k)%360 == 0:
    print(k)
    break