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 math

turn_angle = int(input())

current_angle = 90
position_dict = {'x': 0, 'y': 0}
move_one = {'x':0, 'y': 1}
num_actions = 1


def change_angle(turn_angle, current_angle):
    current_angle = current_angle + turn_angle
    if current_angle > 360:
        current_angle = current_angle - 360
    return current_angle

def resolve_direction(current_angle):
    radian_angle = (current_angle*math.pi)/180
    move_dict = {'x':round(math.cos(radian_angle), 3), 'y' : round(math.sin(radian_angle), 3)}
    return move_dict

def move_skater(position_dict, move_dict):
    for key, value in position_dict.items():
        position_dict[key] = round((value + move_dict.get(key, 0)), 3)
    return position_dict

position_dict = move_skater(position_dict, move_one)
current_angle = change_angle(turn_angle, current_angle)


origin_dict = {'x': 0.0, 'y': 0.0}

while position_dict != origin_dict:
    move_dict = resolve_direction(current_angle)
    position_dict= move_skater(position_dict, move_dict)
    current_angle = change_angle(turn_angle, current_angle)
    num_actions = num_actions + 1

print(num_actions)

Submission status: Accepted

Solution code:
def do():
    x=int(input())
    k=360%x
    j=360//x
    v=k
    if k==0:
        return j
    while 360%k!=0:
        k=360%k
        v+=k
    v1=360//v
    return j*v1
print(do())

Submission status: Accepted

Solution code:
from math import gcd

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

Submission status: Accepted

Solution code:

r=int(input())
d=360
while d%r!=0:
    d+=360
print(d//r)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(x,y):
    if x<y:
        x,y=y,x
    if y==0:
        return x
    return gcd(y,x%y)
def lcm(x,y):
    return x*y//gcd(x,y)

def main():
    x=int(input())
    l=lcm(360,x)
    print(l//x)
    
if __name__=='__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    x = int(input())
    if False:
        print((360 // x) if 360%x == 0 else (360 // x)+1)
    else:
        k = 1
        temp = x
        while temp % 360 != 0:
            k += 1
            temp += x
        print(k)


    temp = 360 // x

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main():
    N = int(input())
    K = 0
    X = 0
    Y = 0
    R = 90

    while True:
        R = (N+R)%360
        K+=1
        X += math.cos(math.radians(R))
        Y += math.sin(math.radians(R))
        if abs(X)<0.0005 and abs(Y)<0.0005:
            print(K)
            break

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
#print(math.cos(math.radians(90)))
#exit()
x = int(input())
print(360//math.gcd(360,x))

Submission status: Accepted

Solution code:
import numpy as np

x = int(input())

d = 180 - x
ans = 360 // np.gcd(360, 180-d)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
if(360%n==0):
  print(360//n)
else:
  i=1;
  while (n*i)%360!=0:
    i+=1
  print(i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = int(input())
ct = 1
goal = k
while k:
  ct += 1
  k = (k + goal) % 360
print(ct)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
k = (int)(input())
if k % 360 == 0:
  print(1)
elif k % 180 == 0:
  print(2)
elif k % 120 == 0:
  print(3)
elif k % 90 == 0:
  print(4)
elif k % 72 == 0:
  print(5)
elif k % 60 == 0:
  print(6)
elif k % 45 == 0:
  print(8)
elif k % 40 == 0:
  print(9)
elif k % 36 == 0:
  print(10)
elif k % 30 == 0:
  print(12)
elif k % 24 == 0:
  print(15)
elif k % 20 == 0:
  print(18)
elif k % 18 == 0:
  print(20)
elif k % 15 == 0:
  print(24)
elif k % 12 == 0:
  print(30)
elif k % 10 == 0:
  print(36)
elif k % 9 == 0:
  print(40)
elif k % 8 == 0:
  print(45)
elif k % 6 == 0:
  print(60)
elif k % 5 == 0:
  print(72)
elif k % 4 == 0:
  print(90)
elif k % 3 == 0:
  print(120)
elif k % 2 == 0:
  print(180)
else:
  print(360)

Submission status: Accepted

Solution code:
x=int(input())
c=0
n=0
if 360%x ==0:
    print(int(360/x))
else:
    while not(n==0 and c>0):
        n=(n+x%360)%360
        c+=1
    print(c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def main():
    X = int(input())
    ans = 0
    x = 360
    while x != 0:
        x = x - X
        ans += 1
        if (x < 0):
            x += 360
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())
total = 0
ans = 0

i = 0
while i == 0:
    total = total + x
    ans = ans + 1
    if total % 360 == 0:
        print(ans)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
x = a
k = 1
while a != 360:
    a = a + x
    if a > 360 :
        a = a - 360
    k = k + 1
print(k)

Submission status: Accepted

Solution code:
def gcda(a,b):
    if a < b:
        a, b = b, a
    r = a % b
    if r == 0:
        return b
    return gcda(r, b)

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

X=int(input())
shukai=360
while True:
    if shukai%X==0:
        print(shukai//X)
        exit()
    else:
        shukai=lcm(shukai,X)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x = int(input())

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
x = int(input())
y = 0
m = 1
if 360 % x == 0:
    m = int(360 / x)
else:
    for i in range(1, 1000):
        y = x * i
        if y > 360:
            if y % 360 == 0:
                m = i
                break
                
print(m)

Submission status: Accepted

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

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:
from math import gcd
x = int(input())
y = x*360//gcd(x,360)
print(y//x)

Submission status: Accepted

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

while True:
  if (float(b/360)).is_integer(): print(a);break
  else:b += x;a+=1

Submission status: Accepted

Solution code:
X = int(input())
num = []
kekka = []
N = 2
if 360 % X == 0:
    print(int(360/X))
else:
    while N != X:
        if X / N != 1:
            if X % N == 0:
                num.append(N)
                X /= N
            else:
                N += 1
    num.append(N)
    Z = 1
    for i in range(len(num)):
        Z *= num[i]
    en = [2,2,2,3,3,5]
    for i in range(len(num)):
        if num[i] in en:
            kekka.append(num[i])
            en.remove(num[i])
        else:
            kekka.append(num[i])
    for i in range(len(en)):
        kekka.append(en[i])
    Y = 1
    for i in range(len(kekka)):
        Y *= kekka[i]
    print(int(Y / Z))

Submission status: Accepted

Solution code:
X = int(input())

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

print(count)

Submission status: Accepted

Solution code:
import math
x = int(input())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
if x == 1:
  print(int(360 / x))
elif x == 45:
  print(int(360 / x))
elif x == 90:
  print(int(360 / x))
else:
  z = lcm(x, 360)
  print(int(z / x))

Submission status: Accepted

Solution code:
from sys import stdin,stdout
# from math import pi
# from collections import deque
# from heapq import heappush,heappop
Pi = lambda x: stdout.write(str(x) + '\n')
Ps = lambda x: stdout.write(str(x))
S = lambda x: x*(x+1) // 2
I = lambda x: 1+(2*x)
R = lambda:stdin.readline()
Ri = lambda x:map(int,x.split())
Rs = lambda x:map(str,x.split())
Rf = lambda x:map(float,x.split())
char = lambda x,y:ord(x) - ord(y) 
gcd = lambda a,b: a if b==0 else gcd(b, a%b) 
lcm = lambda a,b: a * b // gcd(a, b)
# find = lambda u,par: u if u==par[u] else find(par[u],par)
distance = lambda a,b,c,d: ((a-c)**2) + ((b-d)**2)
# distance = lambda a,b,c,d: (abs(a-c)) + (abs(b-d))
MaxN = int(1e6) + 10
mod = int(1e9) + 7
# global fx,fy
# fx = [-2, -2, -1, -1,  1, 1,  2, 2]
# fy = [-1,  1, -2,  2, -2, 2, -1, 1]
# fx,fy = [0,0,-1,1],[1,-1,0,0]
 
def main():             
    for x in stdin:     
        if x=='\n':continue    
        n = int(x)
        ans = 1
        while (ans*n)%360!=0:
        	ans += 1
        Pi(ans)

if __name__ == '__main__':
       	main()

Submission status: Accepted

Solution code:
import sys
import math
from collections import defaultdict
from bisect import bisect_left, bisect_right

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def LI(): return list(map(int, input().split()))
def LIR(row,col):
    if row <= 0:
        return [[] for _ in range(col)]
    elif col == 1:
        return [I() for _ in range(row)]
    else:
        read_all = [LI() for _ in range(row)]
        return map(list, zip(*read_all))

#################

X = I()

count = 1
eps = 10**(-6)
now = [0,1]
while True:
    count += 1
    now[0] -= math.sin(math.radians((count-1)*X))
    now[1] += math.cos(math.radians((count-1)*X))
    if abs(now[0]) < eps and abs(now[1]) < eps:
        print(count)
        exit()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# get a integer
a = int(input())

m = a
c = 1
while m % 360 != 0:
	m+=a
	c+=1
print(c)

Submission status: Accepted

Solution code:
x = int(input())
tmp = 0
ans = 0

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sin, cos, pi
import cmath
x = int(input())
i = 0
now = 0+0j

while True:
    now += cmath.rect(1,2*pi*x*i/360)
    i += 1
    if abs(now-(0+0j)) < 10**(-8):
        break
print(i)

Submission status: Accepted

Solution code:
import sys

def _i(): return int(sys.stdin.readline().strip())


def gcd(x, y):
    if x < y:
        x, y = y, x
    if x % y == 0:
        return y
    else:
        return gcd(y, x % y)


def main():
    a = _i()
    return 360 // gcd(360, a)


if __name__ == "__main__":
    print(main())

Submission status: Accepted

Solution code:
a = int(input())
res = 0
remainer = 0
while True:
    res += (360+remainer)//a
    remainer = (360+remainer)%a
    if remainer==0:break
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
#print(math.cos(math.radians(90)))
#exit()
n = int(input())
x = 0
y = 1
deg = 90 - n
cnt = 1
#print(x<-10**(-5))
while 1 == 1:
    x += math.cos(math.radians(deg))
    y += math.sin(math.radians(deg))
    deg -= n
    cnt += 1
    if x > -10**(-5) and x < 10**(-5) and y > -10**(-5) and y < 10**(-5):
        break
print(cnt)

Submission status: Accepted

Solution code:
X = int(input())

K = 0
rad = 360
while rad != 0:
    rad -= X
    K += 1
    if rad < 0:
        rad += 360
print(K)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(X):
    cnt = 1
    while True:
        if (X * cnt) % 360 == 0:
            return cnt
        else:
            cnt += 1

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
x = int(input())
x_max = 179

for i in range(1,x_max+1):
    if((360 * i) % x == 0):
        tmp = (360 * i) / x
        print(int(tmp))
        break

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def lcm(a, b):
    max_num = max(a, b)
    while True:
        if max_num % a == 0 and max_num % b == 0:
            break
        max_num += 1
    return max_num


n = int(input())
l = lcm(n, 360)
print(l//n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import math

rotate = int(input())

x = 0
y = 1
heading = 90

count = 1

while True:
    heading += rotate
    x += np.cos(np.deg2rad(heading))
    y += np.sin(np.deg2rad(heading))
    count += 1
    #print('heading', heading)
    #print('x : ', x)
    #print('y : ', y)

    if math.isclose(x, 0.0,abs_tol=0.000001) and math.isclose(y, 0.0,abs_tol=0.0000001):
        break

print(count)

Submission status: Accepted

Solution code:
x = int(input())
r = 360
count = 0
while r != 0:
  r = r - x
  if r < 0:
    r += 360
  count += 1
print(count)

Submission status: Accepted

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

import math
#from decimal import Decimal

# スペース区切りの整数の入力
#N, K = map(int, input().split())
# 文字列の入力
X = int(input())
#開業されたN個要素を受け付ける
#input_list = [list(map(int, input().split())) for i in range(N)]

#x_co = math.sin(math.radians(30))
#y_co =

#math.sin(math.radians(30))
lcm = (X * 360) / math.gcd(X, 360)

#while(360%X == 0)

print(int(lcm / X))

Submission status: Accepted

Solution code:
X = int(input())

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

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

Submission status: Accepted

Solution code:
import argparse
import collections
import logging.config
import sys
import csv
import numpy as np

def tstr(n):
  total = n
  cnt = 1
  while total%360 != 0:
#    print (str(cnt) + "," + str(total))
    cnt += 1
    total += n 
  return (cnt)


def main():
  N = int(input())
  print (tstr(N))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    x = int(input())

    count = 0
    theta = 0
    while True:
        count += 1
        theta += x
        if theta%360 == 0:
            break

    print(count)

Submission status: Accepted

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


M = 1000000
P = 180


def compute(x):
    for n in range(1, M):
        k, mo = divmod(2 * n * P, x)
        if mo == 0:
            return k
    raise Exception("Not Found")    


def main():
    x = int(input())
    k = compute(x)
    print(k)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

from fractions import gcd
x = n * 360 // gcd(n, 360) # float

print(x//n)

Submission status: Accepted

Solution code:
from fractions import Fraction

x = input()

y = Fraction("360/"+x)

print(y.numerator)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)
from math import gcd,ceil

def lcm(a,b):return a*b//gcd(a,b)
x=int(input().rstrip())
print(360//x if 360%x==0 else (lcm(360,x)//x))

Submission status: Accepted

Solution code:
import math
from collections import Counter, defaultdict
FAST_IO = 1
if FAST_IO:
    import io, sys, atexit
    rr = iter(sys.stdin.read().splitlines()).next
    sys.stdout = _OUTPUT_BUFFER = io.BytesIO()
    @atexit.register
    def write():
        sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())
else:
    rr = raw_input
rri = lambda: int(rr())
rrm = lambda: map(int, rr().split())

import math
deg = rri()
d = (-1,0)
cur = (-1, 0)
ans = 1
deg = 2*math.pi*deg/360

while (cur[0]**2+cur[1]**2)>1e-5:
    x, y = d
    new_x, new_y = math.cos(deg)*x-math.sin(deg)*y, math.sin(deg)*x+math.cos(deg)*y
    d = (new_x, new_y)
    cur = (cur[0]+new_x, cur[1]+new_y)
    ans+=1
print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
x=int(input())
import math
y=math.gcd(360,x)
z=x*360//y
ans=z//x
print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

Solution code:
X = int( input() )
K = 1
angle = X
while angle%360>0:
  angle += X
  K += 1
print(K)

Submission status: Accepted

Solution code:
import collections

def main():
    n = int(input())
    dd=collections.defaultdict(int)
    for i in range(1,n+1):
        dd[i*360]+=1
    for i in range(360*(n+1)):
        if(dd[n*i]>0):
            print(i)
            exit()


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def factor(n):
  l=[]
  while n%2==0:
    n=n//2
    l.append(2)
  for i in range(3,int(n**0.5)+1,2):
    while n%i==0:
      n=n//i
      l.append(i)
  if n>2:
    l.append(n)
  return l

n=int(input())
if 360%n==0:
  print(360//n)
else:
  ll=factor(n)
  mul=1
  #print(ll)
  use=360
  for i in range(len(ll)):
    if use%ll[i]==0:
      use=use//ll[i]
    else:
      mul*=ll[i]
  print((360*mul)//n)

Submission status: Accepted

Solution code:
import math
degree =int(input())
degree = math.radians(degree)
count = [1]
x, y = 0, 0
for i in count:
    xi, yi = math.cos(i * degree), math.sin(i * degree)
    x += xi
    y += yi
    if -0.000001 <= x<= 0.000001 and -0.000001 <= y<= 0.000001:
        print(i)
    else:
        count.append(i+1)

Submission status: Accepted

Solution code:
import math

ang = int(input())
rad = ang/360*(2*math.pi)

k = 1
x = 1.0
y = 0.0
current = 0
while round(x,3) != 0.0 or round(y,3) != 0.0:

    current += rad
    x += math.cos(current)
    y += math.sin(current)

    k+=1

print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def move(i,j,angle):
    rad = 2*(angle/360)*math.pi
    si = i + math.cos(math.radians(angle))
    sj = j + math.sin(math.radians(angle))
    return [round(si,5),round(sj,5)]

x = int(input())

i,j = 0,0
angle = 90
ans = 0
# t=10
while 1:
    # t-=1
    i,j = move(i,j,angle)
    # print(str(i) +'  '+str(j))
    angle += x
    ans += 1
    if(i == 0 and j == 0):
        break

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

X = float(input())
posx = 0.0
posy = 0.0
K = 0
theta = 0.0
while True:
    posx += np.cos(theta)
    posy += np.sin(theta)
    theta += X / 180 * np.pi
    K += 1
    if np.abs(posx) < 0.000000001 and np.abs(posy) < 0.000000001:
        break
print(K)

Submission status: Accepted

Solution code:
X = int(input())

theta, k = 0, 0
while theta != 360:
    theta += X
    k += 1
    if theta > 360:
        theta -= 360
print(k)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil
x = int(input())
n = 360
while(n%x):
	n+=360

print(n//x)

Submission status: Accepted

Solution code:
from math import gcd
def resolver(X):
    i = 1
    while True:
        if (360 * i) % X == 0:
            return (360 * i) // X
        i += 1



def main():
    X = int(input())
    ans = resolver(X)
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import gcd

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

Submission status: Accepted

Solution code:
import math 
c = int(input())
a = 90
x,y = 0,0
e = 0.000000001

k = 1
x = math.sin(math.radians(a))
y = math.cos(math.radians(a))
while (x < -e or x > e or y < -e or y > e):
  a += c
  x += math.sin(math.radians(a))
  y += math.cos(math.radians(a))
  k += 1
print(k)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(i)

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(cnt)

Submission status: Accepted

Solution code:
X=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


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

Submission status: Accepted

Solution code:
import copy
X = input()
X = int(X)
A = copy.deepcopy(X)

i = 2

if 360 % X == 0:
    K = 360 / X
    K = int(K)
    print(K)
else:
    while True:
        X = copy.deepcopy(A)
        X *= i
        if X % 360 == 0:
            break
        i = i+1

    print(i)

Submission status: Accepted

Solution code:
X=int(input())
p=360
cnt=0

while p%X !=0:
    p += 360

print(p//X)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
X=int(input())
Xjiku=float(1)
Yjiku=float(0)
ans=int(1)
thita=int(0)
for _ in range(1000000):
    thita += X
    Xjiku += math.cos(math.radians(thita))
    Yjiku += math.sin(math.radians(thita))
    ans += int(1)
    if abs(Xjiku) < float(10**-10) and abs(Yjiku) < float(10**-10):
        break
print(ans)

Submission status: Accepted

Solution code:
import math

x = int(input())

print(int(360 / math.gcd(360,x)))

Submission status: Accepted

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

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
x = int(input())
lcm = x * 360 / math.gcd(x, 360)
print(int(lcm / x))

Submission status: Accepted

Solution code:
x=int(input())
y=x;
k=1;
while(x%360):
  x+=y;k+=1;
print(k)

Submission status: Accepted

Solution code:

import math

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

X = int(input())

a=lcm(X,360)

print(a//X)

Submission status: Accepted

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

print(int(count))

Submission status: Accepted

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

def main():
    X = int( input())
    # if X > 90:
    #     X -= 90
    for i in range(1, X+1):
        if i*360%X == 0:
            print(i*360//X)
            return
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

X = int(input())
deg = 360

if deg%X==0:
    ans = deg//X
else:
    ans = ((deg*X)//math.gcd(deg,X))//X

print(ans)

Submission status: Accepted

Solution code:
X = int(input())

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

  
print(K)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from math import gcd
n = int(input())
print(360//gcd(360, n))

Submission status: Accepted

Solution code:
a = int(input())
k = 0
t = 1
count = 0
while t == 1 :
     k = k + a
     count = count + 1
     if k % 360 == 0 :
         break

print(count)

Submission status: Accepted

Solution code:
angle = int(input())

count = 0

while True:
  count += 1
  num = angle * count

  if num % 360 == 0:
    print(count)
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(i)

Submission status: Accepted

Solution code:
X = int(input())
# X=70

k=0
a=0
while True:

  a = (a+X)%360
  k+=1
  if a==0: break

print(k)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math
import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()

def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(X):
    d = [1, 0]
    c = [0, 0]
    eps = 10**-7
    X /= 360
    X *= 2*math.pi
    for i in range(1, 361):
        c[0] += d[0]
        c[1] += d[1]
        d = [
            d[0]*math.cos(X) - d[1]*math.sin(X),
            d[0]*math.sin(X) + d[1]*math.cos(X)
        ]

        if abs(c[0]) < eps and abs(c[1]) < eps:
            return i
    return i


def main():
    X = read_int()
    print(slv(X))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
x = int(input())

sum = 0
times = 0
while sum==0 or sum%360 != 0:
  sum += x
  times += 1

print(times)

Submission status: Accepted

Solution code:
N = int(input())
for i in range(360):
    if not N * (i + 1) % 360:
        print(i + 1)
        break

Submission status: Accepted

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

X=int(input())

if 360%X==0:
    print(360//X)
else:
    g =gcd(360,X)
    print(360//g)

Submission status: Accepted

Solution code:
import sys
import math
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化
from fractions import gcd

def main():
    x = int(input())
    print(360//math.gcd(x, 360))
    
    return 0

if __name__ == "__main__":
    main()