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:
m = int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
x = make_divisors(360)

#最大公約数
def gcd(a,b):
    if(b>a):
        a,b=b,a
    i=b
    while i>0:
        if(a%i==0 and b%i==0):
            return i
        i-=1

#最小公倍数
def lcm(a,b):
    return int(a*b/gcd(a,b))

y = lcm(m,360)

if m in x:
    print(360//m)
else:
    print(y//m)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
import math
A = X // math.gcd(360, X)
ans = 360 * A // X
print(ans)

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
x = I()
ans = 0
wa = 0
cont = True
while cont:
    wa += x
    ans += 1
    if wa % 360 == 0:
        cont = False
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    X = int(input())
    tmp = 0
    cnt = 0
    while True:
        tmp += X
        cnt += 1
        tmp %= 360
        if tmp == 0:
            break
    return cnt 

print(main())

Submission status: Accepted

Solution code:
X = int(input())

for k in range(3, 361):
    if (k*X)%360==0:
        print(k)
        exit()

Submission status: Accepted

Solution code:
import sys
import math

X = int(sys.stdin.readline())
for i in range(1, 10**5):
    if (X * i) % 360 == 0:
        print(i)
        break

Submission status: Accepted

Solution code:
from sys import stdin
rs = lambda : stdin.readline().strip()
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))

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

def main():
    X = ri()
    K = 360 // gcd(360, X)
    print(K)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
X = int(input())
a = gcd(360,X)
b = (X//a)*360
print(b//X)

Submission status: Accepted

Solution code:
from fractions import gcd

x = int(input())

print(x * 360 // gcd(x, 360) // x)

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 statistics
# import itertools
a=int(input())
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#     c.append(int(i))
#e1,e2= map(int,input().split())
# f = list(map(int,input().split()))
#g = [input() for _ in range(e1)]
n=1
while True:
    if 360*n%a==0:
        print(360*n//a)
        exit()
    else:
        n+=1

Submission status: Accepted

Solution code:
X = int(input())

eikaku = X if X < 180 else X - 180
cnt = 0

ans = 0
while True:
    ans += 1
    cnt += eikaku
    if cnt % 360 == 0:
        print(ans)
        break

Submission status: Accepted

Solution code:
def main():
    # n = int(input())
    # h, w, k = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = input()
    x = int(input())
    i = 1
    while (x*i) % 360 != 0:
        i += 1
    print(i)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())
a = 1
for i in [2,2,2,3,3,5]:
  if x%i == 0:
    a *= i
    x //= i
print(360//a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

num = 360

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

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
x = int(input())
if 360%x == 0:
    print(int(360/x))
else :
    print(int(lcm(360,x)/x))

Submission status: Accepted

Solution code:
X = int(input())

if 360 % X == 0:
    print(360 // X)
    exit()
else:
    mod = 0
    cnt = 0
    while (360 + mod) % X != 0:
        cnt += (360 + mod) // X
        mod = (360 + mod) % X
    cnt += (360 + mod) // X

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    i = 1
    now = n
    while True:
        if now % 360 == 0:
            print(i)
            break
        else:
            i += 1
            now += n


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
import sys
import math
def input(): return sys.stdin.readline().rstrip()
def main():
    x = int(input())
    xx = x
    ans = 1
    while xx%360 != 0:
        xx += x
        ans += 1
    print(ans )

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 int(a * b / gcd(a, b))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())

count=1

while True:
  if X*count%360==0:
    break
  else:
    count=count+1

print(count)

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())
k = 1
while(True):
  if k * x % 360 == 0:
    print(k)
    break
  else:
    k += 1

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    theta = 360
    k = 0

    while True:
        if theta % x == 0:
            k = theta // x
            break
        theta += 360

    print(k)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
n=int(input())
ans=0
count=0
while True:
  if ans!=0 and ans%360==0:
    break
  else:
    count+=1
    ans+=n
print(count)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

def lcm(a, b):
    a, b = max(a, b), min(a, b)
    c = a * b
    while a % b > 0:
        a, b = b, a % b
    return c // b


def solve():
    input = sys.stdin.readline
    X = int(input())
    L = lcm(360, X)
    print(L // X)

    return 0

if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
import math
print([ ( int(x) * 360 // math.gcd(int(x),360) ) // int(x) for x in input().split(' ') ][0])

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil,pi,factorial
    from operator import itemgetter
    def I(): return int(input())
    def MI(): return map(int, input().split())
    def LI(): return list(map(int, input().split()))
    def LI2(): return [int(input()) for i in range(n)]
    def MXI(): return [[LI()]for i in range(n)]
    def SI(): return input().rstrip()
    def printns(x): print('\n'.join(x))
    def printni(x): print('\n'.join(list(map(str,x))))
    inf = 10**17
    mod = 10**9 + 7
#main code here!
    def gcd(a, b):
        while b:
            a, b = b, a % b
        return a
    x=I()
    print(360//gcd(360,x))


                
    
    
    
            
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()


def main():
	x=II()

	a=0

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





if __name__ == "__main__":
	main()

Submission status: Accepted

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

Submission status: Accepted

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

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, product # (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でやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入g
import sys
sys.setrecursionlimit(10000000)
#mod = 10**9 + 7
#mod = 9982443453
mod = 998244353
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
x = I()
xgcd = gcd(x,360)
xlcm = 360 * x // xgcd
print(xlcm//x)

Submission status: Accepted

Solution code:
X = int(input())
T = 0
ans = 0
while (1):
  T = (T+X)%360
  ans += 1
  if (T == 0):
    break
print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
X = int(input())
a = gcd(X,360)
Y = (X//a)*360
print(Y//X)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
a = 360
for _ in range(360):
    if a%x == 0:
        print(a//x)
        break
    else:
        a += 360

Submission status: Accepted

Solution code:
import sys
import math
input = sys.stdin.readline
ins = lambda: input().rstrip()
ini = lambda: int(input().rstrip())
inm = lambda: map(int, input().split())
inl = lambda: list(map(int, input().split()))

n = ini()
count = n
ans = 1
while count != 0:
    count = (count + n) % 360
    ans += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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())
a=[]
for i in range(1,X+1):
    a.append(360*i)
for k in range(len(a)):
    if a[k]%X==0:
        print(int(a[k]//X))
        break

Submission status: Accepted

Solution code:
X=int(input())
i=1

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

Submission status: Accepted

Solution code:
import math

x = int(input())
if 360 % x == 0:
    print(360 // x)
else:
    common = 360 * x // math.gcd(360, x)
    ans = common // x
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

X = int(input())
from math import gcd
print(360*X//gcd(360, X)//X)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
k = 1
while True:
  if k*N%360==0:
    print(k)
    exit()
  else:
    k+=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin

input = stdin.readline

def main():
    X = int(input().rstrip())
    ans = 1
    n = X
    while(n % 360 != 0):
        n += X
        ans += 1 
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = int(input())
y = x
while y % 360:
    y += x
print(y//x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=int(input())
x = 0
i = 0
while(1):
  x += a
  i += 1
  x %= 360
  if x:
    continue
  else:
    print(i)
    quit()

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())

cnt = 0
x = 0
while True:
    x += X
    cnt += 1
    if x % 360 == 0:
        print(cnt)
        exit()

Submission status: Accepted

Solution code:
x = int(input())

idx = 0
tmp = 0
while 1:
    tmp += x
    idx += 1
    if tmp % 360 == 0:
        break

print(idx)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
moji=[]
moji.append("eraser")
moji.append("erase")
moji.append("dreamer")
moji.append("dream")
user = "erasedream"
user = int(input())
result = user
count = 1

while result != 0:
    result += user
    result %= 360
    count += 1
print(count,end="")

Submission status: Accepted

Solution code:
X=int(input())

for i in range(1,180):
    if (i*360%X==0):
        print((i*360)//X)
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

a = int(input())

print(int(360*a/math.gcd(360,a)/a))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
ans = 0
W = 360
while(True):
    W -= X
    ans += 1
    if W == 0:
        break
    if W < 0:
        W += 360
print(ans)

Submission status: Accepted

Solution code:
X = int(input())
n = 2
k = 0

k = 360//X
while(360*(n-1) % X != 0):
    k = (360*n)//X
    n += 1

print(k)

Submission status: Accepted

Solution code:
import sys

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


for line in sys.stdin:
    line = line.strip()
    if line == "":
        break

    X = int(line)
    ans = 360 // gcd(X, 360)
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

lcm = (x * 360)/gcd(x, 360)
print(int(lcm/x))

Submission status: Accepted

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


a()

Submission status: Accepted

Solution code:
x = int(input())
y = 360
while y % x != 0:
  y += 360
print(y // x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

X = int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

n=1

while 1:
    angle_n = 360*n
    if angle_n % x == 0:
        ans = angle_n // x
        break
    else:
        n += 1

print(ans)

Submission status: Accepted

Solution code:
x=int(input())

i=1
while i*x%360!=0:
    i+=1
print(i)

Submission status: Accepted

Solution code:
import math
arg = int(input())
# x, y, theta
where = [0, 0, 0]
counter = 0
while where != [0,0,0] or counter == 0:
  # walk
  math.sin(math.radians(30))
  where[0] += where[0]*math.sin(math.radians(where[2]))
  where[1] += where[1]*math.cos(math.radians(where[2]))
  where[2] = (where[2]+arg)%360
  #print(where)
  counter += 1

print(counter)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
ans = 1
theta = x

while theta != 0:
	ans += 1
	theta = (theta + x) % 360
	
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
import math
import numpy as np
#N = int(input())
#A = list(map(int,input().split()))
x = int(input())
#x, y = map(int,input().split())
for i in range(1,10**5):
    if (i*x)%360==0:
        print(i)
        break

Submission status: Accepted

Solution code:
#  =========     /\       /|    |====/|
#      |        /  \       |    |   / |
#      |       /____\      |    |  /  |
#      |      /      \     |    | /   |
#  ========= /        \  =====  |/====|  
#  code

def main():
    x = int(input())
    k = 1
    while ( x * k ) % 360:
        k += 1
    print(k)
    return

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main2():
    x = int(input())

    k = 1
    while x*k % 360 != 0:
        k += 1

    print(k)

if __name__ == "__main__":
    main2()

Submission status: Accepted

Solution code:
import math
def main():
    d = int(input())
    th = 90

    eps = 10**(-12)
    x = y = ans = 0
    while True:
        x += math.cos(math.radians(th))
        y += math.sin(math.radians(th))
        ans += 1

        if abs(x) <= eps and abs(y) <= eps:
            print(ans)
            break
        else:
            th += d

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())


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


print((360 * n // gcd(360, n)) // n)

Submission status: Accepted

Solution code:
import math
N= int(input())
if 360%N==0:
  print(int(360/N))
elif 360%N!=0:
  a = math.gcd(360,N)
  print(int(360/a))

Submission status: Accepted

Solution code:
from math import *

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())
if 360%x == 0:
    print(int(360/x)) #2 * 2 * 2 * 3 * 3 * 5
else:
    count_2 = 0
    count_3 = 0
    count_5 = 0
    while x % 2 == 0:
        count_2 += 1
        x /= 2
        if count_2 == 3:
            break
    while x % 3 == 0:
        count_3 += 1
        x /= 3
        if count_3 == 2:
            break
    while x % 5 == 0:
        count_5 += 1
        x /= 5
        if count_5 == 1:
            break
    print((2**(3-count_2))*(3**(2-count_3))*(5**(1-count_5)))

Submission status: Accepted

Solution code:
import math
from math import gcd
INF = float("inf")

import sys
input=sys.stdin.readline
import itertools
from collections import Counter

def main():
    d = int(input())
    d = math.radians(d)
    x = 0
    y = 1
    cnt = 1
    while True:
        if abs(x)<=0.001 and abs(y) <=0.001:
            print(cnt)
            exit()
        x -= math.sin(d*cnt)
        y += math.cos(d*cnt)
        cnt += 1

if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

for i in range(1,361):
  if (n*i)%360==0:
    print(i);exit()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
K = 1

while K > 0:
  if X * K % 360 == 0:
    print(K)
    break
  else:
    K += 1

Submission status: Accepted

Solution code:
x=int(input())
if(360%x==0):
    print(int(360/x))
elif(360%(180-x)==0):
    print(int(360/(180-x)))
else:
    m=2
    while(1):
        if((360*m)%x==0):
            print(int(360*m/x))
            break
        elif((360*m)%(180-x)==0):
            print(int(360*m/(180-x)))
            break
        m+=1

Submission status: Accepted

Solution code:
from fractions import gcd

def main():
    x = int(input())
    a = gcd(360,x)
    print(360//a)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


x = int(input())

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

Submission status: Accepted

Solution code:
n=int(input())
dx = n
ans = 1
while dx%360>0:
  ans+=1
  dx += n
print(ans)

Submission status: Accepted

Solution code:
import math

n=int(input())
a=int(n*360/math.gcd(n,360))
if n==360:
    print(1)
else:
    print(int(a/n))

Submission status: Accepted

Solution code:
import sys
import math

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    X = int(readline())
    print(360//math.gcd(360,X))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
x=int(input())
a=360
b=x
r=a%b
while r!=0:
  a=b
  b=r
  r=a%b
lcm=x*360/b
k=int(lcm/x)
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

X = int(input())
LCM = X*360/gcd(360, X)
print(int(LCM/X))


#a, b = map(int, input().split())
#print(gcd(a, b))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

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

Submission status: Accepted

Solution code:
a = int(input())
x = a
while x%360:
 x += a
print(x//a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
from math import gcd

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

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

Submission status: Accepted

Solution code:
from math import gcd
from sys import stdin
N = int(stdin.readline().rstrip())
print(360//gcd(N, 360))

Submission status: Accepted

Solution code:
x=int(input())
a=1
while True:

    if (a*x%360==0):
       print(a)
       break
    a+=1

Submission status: Accepted

Solution code:
x=int(input())
k=1
while True:

    if (k*x%360==0):
       print(k)
       break
    k+=1

Submission status: Accepted

Solution code:
X = int(input())

K = 1
d = X
while d % 360 != 0:
    d += X
    K += 1
print(K)

Submission status: Accepted

Solution code:
import math
import sys
from collections import Counter
import bisect
readline = sys.stdin.readline


def main():
    cnt = 0
    arg = 0
    x = int(readline().rstrip())
    for i in range(1000):
        cnt += 1
        arg += x
        arg %= 360
        if arg == 0:
            break
    print(cnt)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    ans = 0
    angle = 0
    while True:
        angle += X
        ans += 1
        if angle % 360 == 0:
            break
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

ans = 0

while True:
    ans += 1
    if ans*x % 360 == 0:
        break

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

k = 1
while not (k*X)%360 == 0:
    k += 1
print(k)

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
i = 1

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