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, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n, d=0): return [d] * n
def array2(n, m, d=0): return [[d] * m for x in range(n)]
def array3(n, m, l, d=0): return [[[d] * l for y in xrange(m)] for x in xrange(n)]

def ldec(A, d=1): return map(lambda x: x - d, A)

N = n1()

for i in range(1, 10**8):
    if (360 * i) % N == 0: 
        print(int((360*i)/N))
        break

Submission status: Accepted

Solution code:
X = int(input())

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

L = lcm(X, 360)
#print('L:', L)

ans = L//X
print(ans)

Submission status: Accepted

Solution code:
X=int(input())

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

ans = int(360*i / X)

print(ans)

Submission status: Accepted

Solution code:
import math

k = int(input())
g = math.gcd(k, 360)
l = k * 360 // g
print(l // k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def compute_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
n=int(input())
if(n%360==0):
  print(n//360)
else:
  print(compute_lcm(n,360)//n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


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

    x = int(input())

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

n = int(input())

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

Submission status: Accepted

Solution code:
X=int(input())

ans=0
tmp=360    

if 360%X==0:
    ans=360//X
else:
    while(1):
        if tmp%X!=0:
            tmp+=360
        else:
            ans=tmp//X
            break
print(ans)

Submission status: Accepted

Solution code:
X = int(input())

def calc(X):
	n = 1
	while True:
		if 360 * n % X == 0:
			return 360 * n // X
		n += 1

print(calc(X))

#for z in range(1, 180):
#	print(z, calc(z))

Submission status: Accepted

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    X = int(input())
    r = X
    ans = 1
    while r % 360 != 0:
        r += X
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def linput(tt=int):
	return list(map(tt,input().split()))

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

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

def main():
	#a,b,c = linput()
	X = int(input())
	
	res = 0
	R = 360
	
	T = 360
	G = 0
	while T!=G:
		if T>G: G+=X; res+=1
		else: T+=R
	
	print(res)

if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
def gcd(x, y):
  b = max(x, y)
  s = min(x, y)
  r = b % s
  while r != 0:
    b = s
    s = r
    r = b % s
  return s

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

X = int(input())

t = lcm(360, X)
k = t // X
print(k)

Submission status: Accepted

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

print((360*i)//X)

Submission status: Accepted

Solution code:
import math

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

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

x=ii()
l=1

while 1:
    if 360*l % x ==0:
        print((360*l)//x)
        exit()
    l += 1

Submission status: Accepted

Solution code:
def resolve():
    X = int(input())
    k = 0
    while 1:
        k += 1
        cal = X * k
        if cal % 360 == 0:
            break
    print(k)
    

if __name__ == "__main__":
    resolve()

Submission status: Accepted

Solution code:
X = int(input())
ls = [2, 2, 2, 3, 3, 5]
a = []
for l in ls:
  if X % l == 0:
    a.append(l)
    X /= l
num = 1
if len(a) != 0:
  for b in a:
    num *= b
print(int(360 / num))

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする
from functools import lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    X= int(input())
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    pi=math.pi
    vec=[1,0]
    ca=0
    cur=[0,0]
    count=0
    count+=1
    cur[0]+=vec[0]
    cur[1]+=vec[1]
    ca=(ca+X)%360
    vec[0]=math.cos(ca/180*pi)
    vec[1]=math.sin(ca/180*pi)
    #print(ca,vec)
    while cur[0]**2+cur[1]**2>1e-8:
        count+=1
        cur[0]+=vec[0]
        cur[1]+=vec[1]
        ca=(ca+X)%360
        vec[0]=math.cos(ca/180*pi)
        vec[1]=math.sin(ca/180*pi)
        #print(ca,cur)
    print(count)






if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    X = int(input())
    ans = INF
    for i in range(1,300):
        if 360*i%X == 0:
            ans = min(ans,360*i//X)
    print(ans)
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

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

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

count = 0
now = 0
while True:
    count += 1
    now += X
    if now % 360 == 0:
        print(count)
        exit()

Submission status: Accepted

Solution code:
X=int(input())
K=0
B=0
C=0
for i in range(0,360):
    B=B+X
    C=B%360
    K=K+1
    if C==0:
        print(K)
        break

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys
import cmath

X = int(input())


def solve(X):
    loc = 0 + 1j
    direction = 0 + 1j
    cnt = 1
    while True:
        if abs(loc - 0) < 1e-6:
            break
        direction *= cmath.rect(1.0, X / 360.0 * 2.0 * math.pi)
        # print("dir: ", direction)
        # print("dir abs: ", abs(direction))
        # loc += 
        loc += direction
        cnt += 1
    return cnt

# for X in range(1, 180):
#     print(X, solve(X))

print(solve(X))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

X = int(input())

ans = 0
x = 0
while((360-x) % X != 0):
    ans += (360 - x) // X + 1
    x = X - (360-x) % X
ans += (360-x) // X
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
X = int(input())
x = 1
y = 0
p = math.pi
count = 1
while abs(x) > 1/100000000 or abs(y) > 1/100000000:
    x += math.cos(count*X*p/180)
    y += math.sin(count*X*p/180)
    count += 1
print(count)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

print(i)

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:
X = int(input())

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

Submission status: Accepted

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


resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def mina(*argv, sub=1): return list(map(lambda x: x - sub, argv))
# 受け渡されたすべての要素からsubだけ引く.リストを*をつけて展開しておくこと


def read_a_int(): return int(read())


def read_ints(): return list(map(int, read().split()))


def read_col(H):
    '''H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_tuple(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_matrix(H):
    '''H is number of rows'''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from math import gcd


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

Submission status: Accepted

Solution code:
x = int(input())

kaiten=360
while kaiten%x!=0:
  kaiten+=360
  
print(kaiten//x)

Submission status: Accepted

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    X=int(input())
    for i in range(1,180):
        if (360*i)%X==0:
            print(int((360*i)//X))
            exit()
    
    
    
if __name__=="__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from math import gcd

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

Submission status: Accepted

Solution code:
x = int(input())
if 360%x != 0:
	turns = int(360/x)+1
	degrees = turns*x
	while degrees%360 != 0:
		degrees += x
		turns += 1
	print(turns)
else:
	print(int(360/x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    x = int(input())
    if 360 % x == 0:
        res = 360 // x
        print(res)
    else:
        q, r = divmod(360, x)
        print((360 // r) * q)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

Solution code:
X = int(input())
flag = 0
K = 0
n = 1
ans = 0


def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


while flag == 0:
    K = (360 * n) / X
    if is_integer_num(K):
        flag = 1
        ans = K
    else:
        n = n + 1

print(int(ans))

Submission status: Accepted

Solution code:
from math import pi, sin, cos


def read_int():
    return int(input())


deg = read_int()
x = 0.0
y = 0.0
theta = 90.0
rad = 180.0 / pi
cnt = 0
while True:
    cnt += 1
    x += cos(theta / rad)
    y += sin(theta / rad)
    theta += deg
    if x * x + y * y <= 1e-6:
        break

print(cnt)

Submission status: Accepted

Solution code:
n = int(input())



from math import cos,sin,pi

x,y=[0,0]
rad = 0
for i in range(10000):
    x += cos(pi*rad*n/180)
    y += sin(pi*rad*n/180)
    rad+=1
    if abs(x) < 0.00001 and abs(y) < 0.00001:
        print(i+1)
        exit()

Submission status: Accepted

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

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

if 360%(n)==0:
    print(360//n)
else:
    print(lcm(360,n)//n)

Submission status: Accepted

Solution code:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

x = ii()
cnt = 1
tmp = x
while tmp%360 != 0:
    cnt += 1
    tmp += x

print(cnt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

# In[22]:


X = int(input())


# In[23]:


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


# In[ ]:

Submission status: Accepted

Solution code:
import sys
# from collections import defaultdict, deque
import math
# import copy
# from bisect import bisect_left, bisect_right
# import heapq

# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 1000000007

def move(cur, deg):
    # print(deg)
    x,y = cur
    x += math.cos(math.radians(deg))
    y += math.sin(math.radians(deg))
    # print(x, y)
    return (x, y)


def solve():
    # print(math.sin(math.radians(90)))
    n = getN()
    eps = 10**-5
    deg = n
    cur = (0, 0)
    ans = 0
    while(True):
        cur = move(cur, deg)
        deg += n
        ans += 1
        cx, cy = cur
        if abs(cx) < eps and abs(cy) < eps:
            print(ans)
            return


def main():
    n = getN()
    for _ in range(n):
        solve()
if __name__ == "__main__":
    # main()
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    X = int(input().strip())
    i = 1
    while True:
        if 360*i%X == 0:
            break
        else:
            i +=  1
    print(int(360*i/X))

Submission status: Accepted

Solution code:
import math

# 整数1個だけ
X = int(input().strip())

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

print(lcm // X)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

print([k for k in range(1, 361) if x*k % 360 == 0][0])

Submission status: Accepted

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math


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


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

Submission status: Accepted

Solution code:
import math

k, = list(map(int,input().split()))
print(abs(360*k) // math.gcd(360, k) // k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")
mod = 10**9 + 7

x = int(input())
import math
lcm = x*360//math.gcd(x, 360)
print(lcm//x)

Submission status: Accepted

Solution code:
X = int(input())
tmp = X
count = 1
while 360 != tmp:
  tmp += X
  count += 1
  if tmp > 360:
    tmp -= 360
print(count)

Submission status: Accepted

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

print(a)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    from sys import stdin
    # from collections import defaultdict
    # from collections import deque
    # from collections import Counter
    # import copy
    # import numpy as np
    import math
    # import random
    input = stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.readline
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(readline())
print(lcm(360, X)//X)

Submission status: Accepted

Solution code:
try:
    from math import gcd
except ImportError:
    from fractions import gcd

x=int(input())

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

Submission status: Accepted

Solution code:
import math


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

    return lcm(360, X) // X


(X,) = [int(x) for x in input().split()]
print(solve(X))

Submission status: Accepted

Solution code:
def gcd(x, y):
    while y: x, y = y, x % y
    return x

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
y = 360
while y != x:
  if x > y:
    x = x - y
  else:
    y = y - x
print(int(360/x))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())
cnt = X
en = 360
ans = 0
while True:
    if en%cnt==0:
        ans = en//X
        break
    if en < cnt:
        en+=360
    cnt += X
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def lcm(x, y):
    return (x * y) // math.gcd(x, y)
x = int(input())
t = lcm(x, 360)
print(t // x)

Submission status: Accepted

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

Submission status: Accepted

Solution code:


x = int(input())

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

Submission status: Accepted

Solution code:
import numpy as np

X = int(input())
y = np.lcm(360,X)
print(y//X)

Submission status: Accepted

Solution code:
def gcd(x,y):
  while y!=0:
    x,y=y,x%y
  return x
print(360//gcd(360,int(input())))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
import heapq
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache


#############
# Constants #
#############

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

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors

#####MakePrimes######
def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum

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

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

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############
N = I()
  
print(360//gcd(N,360))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    x = i_input()

    for i in range(1,1000):
        if 360 * i % x == 0:
            print(360*i//x)
            exit()
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
X = int(input())

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
def GCM(x,y):
  if x%y==0:
    return y
  else:
    return GCM(y,x%y)
  
X = int(input())
print(360//GCM(360,X))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X=int(input())

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

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

Solution code:
X = int(input())
tmp = X
ans = 0
for i in range(2, 10**6):
    tmp += X
    if tmp % 360 == 0:
        ans = i
        break
print(ans)

Submission status: Accepted

Solution code:
import math

X = float(input())

p = 0+0j
d = 1+0j
ans = 0
while True:
  d *= math.cos(X/180.*math.pi)+math.sin(X/180.*math.pi)*1j
  p += d
  ans += 1
  if abs(p)<0.0001:
    break
print(ans)

Submission status: Accepted

Solution code:
x=int(input())

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

Submission status: Accepted

Solution code:
x = int(input())

from math import gcd

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

Submission status: Accepted

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