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

Solution (Python):
X = int(input())

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

Solution (Python):
X = int(input())

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

Solution (Python):

import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True

    @staticmethod
    def fact(N):
        res = {}
        tmp = N
        for i in range(2, int(N ** 0.5 + 1) + 1):
            cnt = 0
            while tmp % i == 0:
                cnt += 1
                tmp //= i
            if cnt > 0:
                res[i] = cnt
        if tmp != 1:
            res[tmp] = 1
        if res == {}:
            res[N] = 1
        return res


def pop_count(x):
    x = x - ((x >> 1) & 0x5555555555555555)
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f
    x = x + (x >> 8)
    x = x + (x >> 16)
    x = x + (x >> 32)
    return x & 0x0000007f


MOD = int(1e09) + 7
INF = int(1e15)


def solve():
    X = Scanner.int()
    for k in range(1, 1000):
        if k * X % 360 == 0:
            print(k)
            return


def main():
    
    
    
    
    
    solve()


if __name__ == "__main__":
    main()

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

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

main()

Solution (Python):
from math import gcd

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

Solution (Python):
X=int(input())
ans=1
while X*ans%360>0:
    ans+=1
print(ans)

Solution (Python):
x = int(input())
for n in range(3, 361):
   if n * x % 360 == 0:
      print(n)
      exit()

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

Solution (Python):
x = int(input())
do = 360
while True:
    if do % x == 0:
        print(do//x)
        break
    else:
        do += 360

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

Solution (Python):

import sys
input = sys.stdin.readline
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]

from fractions import gcd
x = inp()
ans = 360//gcd(360,x)
print(ans)

Solution (Python):
import math
 
k = 1
x = float(input())
while  x*k%360 != 0:
  k += 1	
print(k)

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

Solution (Python):
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

class Geometry:
    """ 幾何学計算用クラス """

    def __init__(self, EPS):
        self.EPS = EPS

    def add(self, a, b):
        x1, y1 = a
        x2, y2 = b
        return (x1+x2, y1+y2)

    def sub(self, a, b):
        x1, y1 = a
        x2, y2 = b
        return (x1-x2, y1-y2)

    def mul(self, a, b):
        x1, y1 = a
        if not isinstance(b, tuple):
            return (x1*b, y1*b)
        x2, y2 = b 
        return (x1*x2, y1*y2)

    def div(self, a, b):
        x1, y1 = a
        if not isinstance(b, tuple):
            return (x1/b, y1/b)
        x2, y2 = b
        return (x1/x2, y1/y2)

    def abs(self, a):
        from math import hypot
        x1, y1 = a
        return hypot(x1, y1)

    def norm(self, a):
        x, y = a
        return x**2 + y**2

    def dot(self, a, b):
        x1, y1 = a
        x2, y2 = b
        return x1*x2 + y1*y2

    def cross(self, a, b):
        x1, y1 = a
        x2, y2 = b
        return x1*y2 - y1*x2

    def project(self, seg, p):
        """ 線分segに対する点pの射影 """

        p1, p2 = seg
        base = self.sub(p2, p1)
        r = self.dot(self.sub(p, p1), base) / self.norm(base)
        return self.add(p1, self.mul(base, r))

    def reflect(self, seg, p):
        """ 線分segを対称軸とした点pの線対称の点 """

        return self.add(p, self.mul(self.sub(self.project(seg, p), p), 2))

    def ccw(self, p0, p1, p2):
        """ 線分p0,p1から線分p0,p2への回転方向 """

        a = self.sub(p1, p0)
        b = self.sub(p2, p0)
        
        if self.cross(a, b) > self.EPS: return 1
        
        if self.cross(a, b) < -self.EPS: return -1
        
        if self.dot(a, b) < -self.EPS: return 2
        
        if self.norm(a) < self.norm(b): return -2
        
        return 0

    def intersect(self, seg1, seg2):
        """ 線分seg1と線分seg2の交差判定 """

        p1, p2 = seg1
        p3, p4 = seg2
        return (
            self.ccw(p1, p2, p3) * self.ccw(p1, p2, p4) <= 0
            and self.ccw(p3, p4, p1) * self.ccw(p3, p4, p2) <= 0
        )

    def get_distance_PP(self, p1, p2):
        from math import hypot

        x1, y1 = p1
        x2, y2 = p2
        return hypot(x1-x2, y1-y2)

    def get_distance_LP(self, line, p):
        """ 直線lineと点pの距離 """

        p1, p2 = line
        return abs(self.cross(self.sub(p2, p1), self.sub(p, p1)) / self.abs(self.sub(p2, p1)))

    def get_distance_SP(self, seg, p):
        """ 線分segと点pの距離 """

        p1, p2 = seg
        if self.dot(self.sub(p2, p1), self.sub(p, p1)) < 0: return self.abs(self.sub(p, p1))
        if self.dot(self.sub(p1, p2), self.sub(p, p2)) < 0: return self.abs(self.sub(p, p2))
        return self.get_distance_LP(seg, p)

    def get_distance_SS(self, seg1, seg2):
        """ 線分seg1と線分seg2の距離 """

        p1, p2 = seg1
        p3, p4 = seg2
        if self.intersect(seg1, seg2): return 0
        return min(
            self.get_distance_SP(seg1, p3), self.get_distance_SP(seg1, p4),
            self.get_distance_SP(seg2, p1), self.get_distance_SP(seg2, p2),
        )

    def get_cross_pointSS(self, seg1, seg2):
        """ 線分seg1と線分seg2の交点 """

        p1, p2 = seg1
        p3, p4 = seg2
        if not self.intersect(seg1, seg2): return (INF, INF)
        if p1 == p2: return p2
        if p3 == p4: return p3
        base = self.sub(p4, p3)
        dist1 = abs(self.cross(base, self.sub(p1, p3)))
        dist2 = abs(self.cross(base, self.sub(p2, p3)))
        t = dist1 / (dist1+dist2)
        return self.add(p1, self.mul(self.sub(p2, p1), t))

    def intersectCL(self, c, line):
        """ 円cと直線lineの交差判定 """

        x, y, r = c
        return self.get_distance_SP(line, (x, y)) <= r

    def get_cross_pointCL(self, c, line):
        """ 円cと直線lineの交点 """
        from math import sqrt

        if not self.intersectCL(c, line): return -1
        x, y, r = c
        p1, p2 = line
        pr = self.project(line, (x, y))
        e = self.div(self.sub(p2, p1), self.abs(self.sub(p2, p1)))
        base = sqrt(r*r - self.norm(self.sub(pr, (x, y))))
        return [self.add(pr, self.mul(e, base)), self.sub(pr, self.mul(e, base))]

    def arg(self, p):
        from math import atan2
        x, y = p
        return atan2(y, x)

    def polar(self, a, r):
        from math import sin, cos
        return (cos(r)*a, sin(r)*a)

    def intersectCC(self, c1, c2):
        """ 円c1と円c2の交差判定 """
        from math import hypot

        x1, y1, r1 = c1
        x2, y2, r2 = c2
        return hypot(x1-x2, y1-y2) <= r1 + r2
    
    def get_cross_pointCC(self, c1, c2):
        """ 円c1と円c2の交点 """
        from math import acos

        if not self.intersectCC(c1, c2): return -1
        x1, y1, r1 = c1
        x2, y2, r2 = c2
        try:
            d = self.abs(self.sub((x1, y1), (x2, y2)))
            a = acos((r1*r1+d*d-r2*r2) / (2*r1*d))
            t = self.arg(self.sub((x2, y2), (x1, y1)))
            return [self.add((x1, y1), self.polar(r1, t+a)), self.add((x1, y1), self.polar(r1, t-a))]
        except:
            
            return -1


def rotate(s, t, dig):
    from math import sin, cos, radians

    x1, y1 = s
    x2, y2 = t
    
    x3 = x1 + (x2-x1) * cos(radians(dig)) - (y2-y1) * sin(radians(dig))
    y3 = y1 + (x2-x1) * sin(radians(dig)) + (y2-y1) * cos(radians(dig))
    return (x3, y3)

x = INT()

gm = Geometry(EPS)
cur = (0, 0)
d = (0, 1)
ans = 0
while 1:
    cur = gm.add(cur, d)
    ans += 1
    if abs(cur[0]) < EPS and abs(cur[1]) < EPS:
        break
    d = rotate((0, 0), d, x)
print(ans)

Solution (Python):
import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 19
MOD = 10 ** 9 + 7
EPS = 10 ** -10

class Geometry:
    """ 幾何学計算用クラス """

    def __init__(self, EPS):
        self.EPS = EPS

    def add(self, a, b):
        x1, y1 = a
        x2, y2 = b
        return (x1+x2, y1+y2)

    def sub(self, a, b):
        x1, y1 = a
        x2, y2 = b
        return (x1-x2, y1-y2)

    def mul(self, a, b):
        x1, y1 = a
        if not isinstance(b, tuple):
            return (x1*b, y1*b)
        x2, y2 = b 
        return (x1*x2, y1*y2)

    def div(self, a, b):
        x1, y1 = a
        if not isinstance(b, tuple):
            return (x1/b, y1/b)
        x2, y2 = b
        return (x1/x2, y1/y2)

    def abs(self, a):
        from math import hypot
        x1, y1 = a
        return hypot(x1, y1)

    def norm(self, a):
        x, y = a
        return x**2 + y**2

    def dot(self, a, b):
        x1, y1 = a
        x2, y2 = b
        return x1*x2 + y1*y2

    def cross(self, a, b):
        x1, y1 = a
        x2, y2 = b
        return x1*y2 - y1*x2

    def project(self, seg, p):
        """ 線分segに対する点pの射影 """

        p1, p2 = seg
        base = self.sub(p2, p1)
        r = self.dot(self.sub(p, p1), base) / self.norm(base)
        return self.add(p1, self.mul(base, r))

    def reflect(self, seg, p):
        """ 線分segを対称軸とした点pの線対称の点 """

        return self.add(p, self.mul(self.sub(self.project(seg, p), p), 2))

    def ccw(self, p0, p1, p2):
        """ 線分p0,p1から線分p0,p2への回転方向 """

        a = self.sub(p1, p0)
        b = self.sub(p2, p0)
        
        if self.cross(a, b) > self.EPS: return 1
        
        if self.cross(a, b) < -self.EPS: return -1
        
        if self.dot(a, b) < -self.EPS: return 2
        
        if self.norm(a) < self.norm(b): return -2
        
        return 0

    def intersect(self, seg1, seg2):
        """ 線分seg1と線分seg2の交差判定 """

        p1, p2 = seg1
        p3, p4 = seg2
        return (
            self.ccw(p1, p2, p3) * self.ccw(p1, p2, p4) <= 0
            and self.ccw(p3, p4, p1) * self.ccw(p3, p4, p2) <= 0
        )

    def get_distance_PP(self, p1, p2):
        from math import hypot

        x1, y1 = p1
        x2, y2 = p2
        return hypot(x1-x2, y1-y2)

    def get_distance_LP(self, line, p):
        """ 直線lineと点pの距離 """

        p1, p2 = line
        return abs(self.cross(self.sub(p2, p1), self.sub(p, p1)) / self.abs(self.sub(p2, p1)))

    def get_distance_SP(self, seg, p):
        """ 線分segと点pの距離 """

        p1, p2 = seg
        if self.dot(self.sub(p2, p1), self.sub(p, p1)) < 0: return self.abs(self.sub(p, p1))
        if self.dot(self.sub(p1, p2), self.sub(p, p2)) < 0: return self.abs(self.sub(p, p2))
        return self.get_distance_LP(seg, p)

    def get_distance_SS(self, seg1, seg2):
        """ 線分seg1と線分seg2の距離 """

        p1, p2 = seg1
        p3, p4 = seg2
        if self.intersect(seg1, seg2): return 0
        return min(
            self.get_distance_SP(seg1, p3), self.get_distance_SP(seg1, p4),
            self.get_distance_SP(seg2, p1), self.get_distance_SP(seg2, p2),
        )

    def get_cross_pointSS(self, seg1, seg2):
        """ 線分seg1と線分seg2の交点 """

        p1, p2 = seg1
        p3, p4 = seg2
        if not self.intersect(seg1, seg2): return (INF, INF)
        if p1 == p2: return p2
        if p3 == p4: return p3
        base = self.sub(p4, p3)
        dist1 = abs(self.cross(base, self.sub(p1, p3)))
        dist2 = abs(self.cross(base, self.sub(p2, p3)))
        t = dist1 / (dist1+dist2)
        return self.add(p1, self.mul(self.sub(p2, p1), t))

    def intersectCL(self, c, line):
        """ 円cと直線lineの交差判定 """

        x, y, r = c
        return self.get_distance_SP(line, (x, y)) <= r

    def get_cross_pointCL(self, c, line):
        """ 円cと直線lineの交点 """
        from math import sqrt

        if not self.intersectCL(c, line): return -1
        x, y, r = c
        p1, p2 = line
        pr = self.project(line, (x, y))
        e = self.div(self.sub(p2, p1), self.abs(self.sub(p2, p1)))
        base = sqrt(r*r - self.norm(self.sub(pr, (x, y))))
        return [self.add(pr, self.mul(e, base)), self.sub(pr, self.mul(e, base))]

    def arg(self, p):
        from math import atan2
        x, y = p
        return atan2(y, x)

    def polar(self, a, r):
        from math import sin, cos
        return (cos(r)*a, sin(r)*a)

    def intersectCC(self, c1, c2):
        """ 円c1と円c2の交差判定 """
        from math import hypot

        x1, y1, r1 = c1
        x2, y2, r2 = c2
        return hypot(x1-x2, y1-y2) <= r1 + r2
    
    def get_cross_pointCC(self, c1, c2):
        """ 円c1と円c2の交点 """
        from math import acos

        if not self.intersectCC(c1, c2): return -1
        x1, y1, r1 = c1
        x2, y2, r2 = c2
        try:
            d = self.abs(self.sub((x1, y1), (x2, y2)))
            a = acos((r1*r1+d*d-r2*r2) / (2*r1*d))
            t = self.arg(self.sub((x2, y2), (x1, y1)))
            return [self.add((x1, y1), self.polar(r1, t+a)), self.add((x1, y1), self.polar(r1, t-a))]
        except:
            
            return -1


def rotate(s, t, dig):
    from math import sin, cos, radians

    x1, y1 = s
    x2, y2 = t
    
    x3 = x1 + (x2-x1) * cos(radians(dig)) - (y2-y1) * sin(radians(dig))
    y3 = y1 + (x2-x1) * sin(radians(dig)) + (y2-y1) * cos(radians(dig))
    return (x3, y3)

x = INT()

gm = Geometry(EPS)
cur = (0, 0)
d = (0, 1)

ans = 0
while 1:
    cur = gm.add(cur, d)
    ans += 1
    if abs(cur[0]) < EPS and abs(cur[1]) < EPS:
        break
    d = rotate((0, 0), d, x)
print(ans)

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

Solution (Python):
x = int(input())

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

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

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

Solution (Python):
import math

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

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

Solution (Python):
x = int(input())
xSum = 0
cnt = 1

while True:
  xSum += x
  if xSum%360 == 0:
    break
  cnt += 1
print(cnt)

Solution (Python):
import math
import sys
sys.setrecursionlimit(10**9)

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

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

if __name__ == "__main__":
  main()

Solution (Python):
from math import *
from copy import *
from string import *				
from random import *
from sys import stdin,stdout
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
import math
import math
import time
from queue import Queue


def seive(n):
	l=[True]
	l=l*(n+1)
	for i in range(2,int(sqrt(n))+1):
		if(l[i]==True):
			val=i*i
			while(val<len(l)):
				l[val]=False
				val+=i
	prime=[]
	for i in range(2,len(l)):
		if(l[i]==True):
			prime.append(i)
	return prime

def dp(l,i,n,val,ans):
	if(i>=n or val<0):
		return 1000000
	elif(val==0):
		return 0
	else:
		if(ans[i]==1000000):
			ans[i]=min(min(1+dp(l,i+1,n,val-l[i],ans),1+dp(l,i,n,val-l[i],ans)),dp(l,i+1,n,val,ans))
		return ans[i]
from queue import Queue
def factors(n):
	l=[]
	for i in range(1,int(sqrt(n))+1):
		if(n%i==0):
			if(n//i==i):
				l.append(i)
			else:
				l.append(i)
				l.append(n//i)
	return l
def check1(s,v,x):
	while(True):
		if(v not in s):
			return v
		else:
			v-=1
def check2(s,v,x):
	while(True):
		if(v not in s):
			return v
		else:
			v+=1

if __name__ == '__main__':
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	x=int(input())
	c=0
	ans=0
	while(ans!=360):
		ans+=x
		if(ans>360):
			ans-=360
		c+=1
	print(c)

Solution (Python):
def main():
    import sys
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines
    sys.setrecursionlimit(10 ** 7)

    from math import gcd

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


if __name__ == '__main__':
    main()

Solution (Python):
x = int(input())
now = 0
ans = 0
while True:
    ans += 1
    now += x
    if now % 360 == 0:
        print(ans)
        exit()

Solution (Python):
X = int(input())

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

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

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

Solution (Python):
X = int(input())

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

Solution (Python):
from math import gcd

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

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

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

Solution (Python):
import sys
from math import gcd

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


def solve():
    X = int(rl())
    
    ans = X * 360 // gcd(X, 360) // X
    print(ans)


if __name__ == '__main__':
    solve()

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

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

Solution (Python):
import math
n=int(input())
mi=1/100000000
x=1
y=0
pi=math.pi
cnt=1
while abs(x)>mi or abs(y)>mi:
  x+=math.cos(cnt*n*pi/180)
  y+=math.sin(cnt*n*pi/180)
  cnt+=1
print(cnt)

Solution (Python):
X = int(input())

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

Solution (Python):
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=lcm(360,X)
print(shukai//X)

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter











import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
X = I()
g = gcd(360,X)
lcm = 360 * X // g

print(lcm // X)

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

Solution (Python):
import math

X = int(input())

g = math.gcd(X, 360)
l = X*360//g
print(l//X)

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

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

Solution (Python):
X = int(input())

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

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

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

Solution (Python):
X = int(input())
x, k = X, 1
while x % 360:
  x += X
  k += 1
print(k)

Solution (Python):
import math
def make_divisors(n):
    divisors = []
    for i in range(1, int(math.sqrt(n))+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort(reverse=True)
    return divisors
def main():
    X = int(input())
    l = make_divisors(X)
    for i in l:
        if 360 % i == 0:
            return (360//i)
print(main())

Solution (Python):
x = int(input())
i = 1
while True:
    a = (360*i) / x
    if a == int(a):
        break
    i += 1
print(int(a))

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

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

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

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

Solution (Python):
from math import gcd

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

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

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

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

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

Solution (Python):
import sys
readline=sys.stdin.readline

X=int(readline())

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

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

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

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

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

Solution (Python):
x = int(input())
y = 0
n =0
while(1):
  n += 1
  y += x
  y %= 360
  if(y==0):
    print(n)
    exit()

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
now = 0
res = 0
while True:
    res += 1
    now += n
    now %= 360
    if now == 0:
        print(res)
        break

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

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

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

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

Solution (Python):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

i = ni()

for j in range(1,360):
    if (360*j)%(360-i) == 0:
        n = (360*j)//(360-i)
        print(n)
        break

Solution (Python):
X = int(input())
from fractions import gcd
def lcm(x, y):
    return x * y // gcd(x, y)
l = lcm(X, 360)
print(l // X)

Solution (Python):
n=[360, 180, 120, 90, 72, 60, 360, 45, 40, 36, 360, 30, 360, 180, 24, 45, 360, 20, 360, 18, 120, 180, 360, 15, 72, 180, 40, 90, 360, 12, 360, 45, 120, 180, 72, 10, 360, 180, 120, 9, 360, 60, 360, 90, 8, 180, 360, 15, 360, 36, 120, 90, 360, 20, 72, 45, 120, 180, 360, 6, 360, 180, 40, 45, 72, 60, 360, 90, 120, 36, 360, 5, 360, 180, 24, 90, 360, 60, 360, 9, 40, 180, 360, 30, 72, 180, 120, 45, 360, 4, 360, 90, 120, 180, 72, 15, 360, 180, 40, 18, 360, 60, 360, 45, 24, 180, 360, 10, 360, 36, 120, 45, 360, 60, 72, 90, 40, 180, 360, 3, 360, 180, 120, 90, 72, 20, 360, 45, 120, 36, 360, 30, 360, 180, 8, 45, 360, 60, 360, 18, 120, 180, 360, 5, 72, 180, 120, 90, 360, 12, 360, 45, 
40, 180, 72, 30, 360, 180, 120, 9, 360, 20, 360, 90, 24, 180, 360, 15, 360, 36, 40, 90, 360, 60, 72, 45, 120, 180, 360]
a=int(input())
print(n[a-1])

Solution (Python):

import math
 
def Strider():
 
    NumA = int(input())
 
    count = 360/NumA
    
    NumB = 1
    
    while ((360*NumB % NumA) != 0):
        NumB = NumB + 1
        count = 360*NumB/NumA
    
    print(int(count))
 
if __name__ == '__main__':
    Strider()

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

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

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

Solution (Python):
import math
x=int(input())
x=180-x

ans=360//math.gcd(360,x)

ex=[60,120]

if(x in ex):
    x=180-x
    ans=360//math.gcd(360,x)
print(ans)

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

Solution (Python):
import math
from fractions import Fraction

x = int(input())


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

Solution (Python):
n=int(input())
for i in range(1, n+1):
  x=360*i%n
  if x==0:
    print(360*i//n)
    break;
  else:
    continue;

Solution (Python):
x=int(input())
ans=0
t=0
for i in range(1081):
  t+=x
  ans+=1
  if t%360==0:
    break
print(ans)

Solution (Python):
from math import gcd

X = int(input())

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

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

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

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

Solution (Python):
ni = lambda: int(input())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

import math

d=ni()

x=0
y=1
cnt=0
dd=0
while True:
  cnt+=1
  dd=(dd+d)%360
  r = math.radians(dd)
  x += math.sin(r)
  y += math.cos(r)

  

  if abs(x)<10**(-10) and abs(y)<10**(-10):
    break
print(cnt+1)

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

Solution (Python):
import numpy as np
import math

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

    res=0
    vec=np.array([1,0])
    rot=np.array([[math.cos(math.radians(X)),-1*math.sin(math.radians(X))],[math.sin(math.radians(X)),math.cos(math.radians(X))]])
    pos=np.array([0,0])

    pos=pos+vec
    vec=np.dot(rot,vec)
    res+=1
    while abs(pos[0])>=0.001 or abs(pos[1])>=0.001:
        pos=pos+vec
        vec=np.dot(rot,vec)
        res+=1
    print(res)

if __name__=="__main__":
    main()

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

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

Solution (Python):
x= int(input())
btdt=[]
theta=x+90
count=0
while(theta not in btdt):
    btdt.append(theta)
    theta=(theta+x)%360
    count+=1
print(count)

Solution (Python):

import math

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


if __name__ == '__main__':
    main()

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

Solution (Python):
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

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

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

if 360%x==0:
    print(int(360/x))

else:
    print(int(lcm(x)/x))

Solution (Python):
x=int(input())
temp=360
while temp%x:
	temp+=360
print(temp//x)

Solution (Python):
x = int(input())

if 360 % x == 0:
    print(360//x)
else:
    mod = 360 % x
    n = 360 // x
    print(n * (360 // mod))

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

Solution (Python):
x=int(input())

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

Solution (Python):
def resolve():
    import math
    x = int(input())

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

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


if 'unittest' not in globals():
    resolve()

Solution (Python):
import numpy as np
def cumsum(x):
    return list(np.cumsum(x))

def cumsum_number(N,K,x):
    ans=[0]*(N-K+1)
    number_cumsum = cumsum(x)
    number_cumsum.insert(0,0)
    for i in range(N-K+1):
        ans[i]=number_cumsum[i+K]-number_cumsum[i]
    return ans
"""
int 
float 


for name in fruits: 
    print(name)


list0 = [] 
list0 = [1,2,3,4] 
list0 = [0]*10 
list1= [i for i in range(10)] 
list1 = list(map(int, input().split()))　
number=[int(input()) for i in range(int(input()))] 
list1 = list1 + [6, 7, 8] 
list2.append(34) 
list.insert(3,10) 
len(list4) 
max(sa) 
list5.count(2) 
list1.sort() 
list1.sort(reverse=True)  
set(list1) 
sum([2,3,   ,3]) 

abs(a) 
max(a,b) min(a,b) 
text1 = text1.replace("34","test") 

exit(0) 

cumsum(リスト) 
cumsum_number(N,K,x) 
"""
X=int(input())
for i in range(1,1001):
    for j in range(1,1001):
        if (360*i)%(X*j)==0:
            ans=360*i//X
            print(ans)
            exit(0)