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

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

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

Solution (Python):
import math

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

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

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

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

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

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

Solution (Python):
import math


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

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

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

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

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

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

from math import gcd

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

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

Solution (Python):
import bisect
import sys
import math
from collections import deque
from heapq import heappush, heappop

def sRaw():
    return input().rstrip("\r")


def iRaw():
    return int(input())


def ssRaw():
    return input().split()


def isRaw():
    return list(map(int, ssRaw()))


INF = 1 << 29

DIV = (10**9) + 7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def CONV_TBL(max, mod=DIV):
    fac, finv, inv = [0]*max, [0]*max, [0]*max
    fac[0] = fac[1] = 1
    finv[0] = finv[1] = 1
    inv[1] = 1
    for i in range(2, max):
        fac[i] = fac[i-1]*i % mod
        inv[i] = mod - inv[mod % i] * (mod//i) % mod
        finv[i] = finv[i-1]*inv[i] % mod

    class CONV:
        def __init__(self):
            self.fac = fac
            self.finv = finv
            pass

        def ncr(self, n, k):
            if(n < k):
                return 0
            if(n < 0 or k < 0):
                return 0
            return fac[n]*(finv[k]*finv[n-k] % DIV) % DIV

    return CONV()


def cumsum(As):
    s = 0
    for a in As:
        s += a
        yield s


sys.setrecursionlimit(200005)


def dijkstra(G,start=0):
    heap = []
    cost = [INF]*len(G)
    heappush(heap,(0,start))
    while len(heap)!=0:
        c,n = heappop(heap)
        if cost[n] !=INF:
            continue
        cost[n]=c
        for e in G[n]:
            ec,v = e
            if cost[v]!=INF:
                continue
            heappush(heap,(ec+c,v))
    return cost


def main():
    X = iRaw()

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




main()

Solution (Python):
from math import gcd

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

if __name__ == "__main__":
    main()

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


main()

Solution (Python):
x = int(input())
"""
xをd倍すると360の倍数になる
"""
cnt = 0
ans = 0
while True:
	cnt += x
	ans += 1
	if cnt % 360 == 0:
		break
print(ans)

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

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

Solution (Python):
import math

x=int(input())

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

Solution (Python):
import math

x = int(input())

g = math.gcd(x, 360)

l = x * 360 / g

ans = l // x

print(int(ans))

Solution (Python):



def solve(*args: str) -> str:
    x = int(args[0])
    k = 1
    y = x
    while y % 360 != 0:
        y = y+x
        k += 1
    return str(k)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))

Solution (Python):
import math

angle = int(input())

print(360 // math.gcd(angle, 360))

Solution (Python):
def f(a,b):
    if b:
        return f(b,a%b)
    return a
print(360//f(int(input()),360))

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

Solution (Python):
def main():
    import sys
    X=int(sys.stdin.readline())
    i=1
    while True:
        if 360*i%X==0:
            print(360*i//X)
            break
        i+=1
main()

Solution (Python):
import numpy as np
import math
import collections
import bisect


X = int(input())

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

Solution (Python):
x = int(input())
count = 0
degree = 360
while degree!=0:
  if degree < 0:
    degree += 360
  degree = degree -x
  count +=1

print(count)

Solution (Python):
X = int(input())
ans = 0
for i in range(1000000):
    ans += X
    if ans % 360 == 0:
        print(i+1)
        exit()

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

Solution (Python):
def main():
    X = int(input())
    t = 0

    for i in range(10**5):
        t += X
        if t % 360 == 0:
            return i + 1

print(main())

Solution (Python):
x = int(input())
ans = 0
p = 360
while p>0:
  if p<x:
    p+=360
  ans += p//x
  p = p%x

print(ans)

Solution (Python):
from math import gcd

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

Solution (Python):

import math
import heapq,bisect
import sys
from collections import deque,defaultdict
from fractions import Fraction
mod=10**9+7
mod1=998244353

import os
import sys
from io import BytesIO, IOBase

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

class SegmentTree1:
    def __init__(self, data, default=9999999, func=lambda a, b:a|b):
        """initialize the segment tree with data"""
        self._default = default
        self._func = func
        self._len = len(data)
        self._size = _size = 1 << (self._len - 1).bit_length()

        self.data = [default] * (2 * _size)
        self.data[_size:_size + self._len] = data
        for i in reversed(range(_size)):
            self.data[i] = func(self.data[i + i], self.data[i + i + 1])

    def __delitem__(self, idx):
        self[idx] = self._default

    def __getitem__(self, idx):
        return self.data[idx + self._size]

    def __setitem__(self, idx, value):
        idx += self._size
        self.data[idx] = value
        idx >>= 1
        while idx:
            self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
            idx >>= 1

    def __len__(self):
        return self._len

    def query(self, start, stop):
        if start == stop:
            return self.__getitem__(start)
        stop += 1
        start += self._size
        stop += self._size

        res = self._default
        while start < stop:
            if start & 1:
                res = self._func(res, self.data[start])
                start += 1
            if stop & 1:
                stop -= 1
                res = self._func(res, self.data[stop])
            start >>= 1
            stop >>= 1
        return res

    def __repr__(self):
        return "SegmentTree({0})".format(self.data)


class SegmentTree:
    def __init__(self, data, default=0, func=lambda a, b: a*a + b*b):
        """initialize the segment tree with data"""
        self._default = default
        self._func = func
        self._len = len(data)
        self._size = _size = 1 << (self._len - 1).bit_length()

        self.data = [default] * (2 * _size)
        self.data[_size:_size + self._len] = data
        for i in reversed(range(_size)):
            self.data[i] = func(self.data[i + i], self.data[i + i + 1])

    def __delitem__(self, idx):
        self[idx] = self._default

    def __getitem__(self, idx):
        return self.data[idx + self._size]

    def __setitem__(self, idx, value):
        idx += self._size
        self.data[idx] = value
        idx >>= 1
        while idx:
            self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
            idx >>= 1

    def __len__(self):
        return self._len

    def query(self, start, stop):
        if start == stop:
            return self.__getitem__(start)
        stop += 1
        start += self._size
        stop += self._size

        res = self._default
        while start < stop:
            if start & 1:
                res = self._func(res, self.data[start])
                start += 1
            if stop & 1:
                stop -= 1
                res = self._func(res, self.data[stop])
            start >>= 1
            stop >>= 1
        return res

    def __repr__(self):
        return "SegmentTree({0})".format(self.data)

class Factorial:
    def __init__(self, MOD):
        self.MOD = MOD
        self.factorials = [1, 1]
        self.invModulos = [0, 1]
        self.invFactorial_ = [1, 1]

    def calc(self, n):
        if n <= -1:
            print("Invalid argument to calculate n!")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        if n < len(self.factorials):
            return self.factorials[n]
        nextArr = [0] * (n + 1 - len(self.factorials))
        initialI = len(self.factorials)
        prev = self.factorials[-1]
        m = self.MOD
        for i in range(initialI, n + 1):
            prev = nextArr[i - initialI] = prev * i % m
        self.factorials += nextArr
        return self.factorials[n]

    def inv(self, n):
        if n <= -1:
            print("Invalid argument to calculate n^(-1)")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        p = self.MOD
        pi = n % p
        if pi < len(self.invModulos):
            return self.invModulos[pi]
        nextArr = [0] * (n + 1 - len(self.invModulos))
        initialI = len(self.invModulos)
        for i in range(initialI, min(p, n + 1)):
            next = -self.invModulos[p % i] * (p // i) % p
            self.invModulos.append(next)
        return self.invModulos[pi]

    def invFactorial(self, n):
        if n <= -1:
            print("Invalid argument to calculate (n^(-1))!")
            print("n must be non-negative value. But the argument was " + str(n))
            exit()
        if n < len(self.invFactorial_):
            return self.invFactorial_[n]
        self.inv(n)  
        nextArr = [0] * (n + 1 - len(self.invFactorial_))
        initialI = len(self.invFactorial_)
        prev = self.invFactorial_[-1]
        p = self.MOD
        for i in range(initialI, n + 1):
            prev = nextArr[i - initialI] = (prev * self.invModulos[i % p]) % p
        self.invFactorial_ += nextArr
        return self.invFactorial_[n]


class Combination:
    def __init__(self, MOD):
        self.MOD = MOD
        self.factorial = Factorial(MOD)

    def ncr(self, n, k):
        if k < 0 or n < k:
            return 0
        k = min(k, n - k)
        f = self.factorial
        return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
    if a == 1 or n == 0:
        return 1
    if n % 2 == 0:
        s = powm(a, n // 2, m)
        return s * s % m
    else:
        return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
    zipped_pairs = zip(list2, list1)

    z = [x for _, x in sorted(zipped_pairs)]

    return z

def product(l):
    por=1
    for i in range(len(l)):
        por*=l[i]
    return por

def binarySearchCount(arr, n, key):
    left = 0
    right = n - 1

    count = 0

    while (left <= right):
        mid = int((right + left) / 2)

        
        
        if (arr[mid] <= key):

            
            
            
            count = mid + 1
            left = mid + 1

        
        else:
            right = mid - 1

    return count

def countdig(n):
    c=0
    while(n>0):
        n//=10
        c+=1
    return c
def countGreater(arr, n, k):
    l = 0
    r = n - 1

    
    
    leftGreater = n

    
    while (l <= r):
        m = int(l + (r - l) / 2)

        
        
        if (arr[m] > k):
            leftGreater = m
            r = m - 1

        
        
        else:
            l = m + 1

    
    
    return (n - leftGreater)

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

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

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

Solution (Python):

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

Solution (Python):
x = int(input())
angle = 0
for i in range(10000):
    angle += x
    if angle % 360 == 0:
        print(i+1)
        break
    elif angle > 360:
        angle %= 360
    else:
        pass

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

Solution (Python):
import bisect
import copy
import heapq
import math
import sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
sys.setrecursionlimit(500000)
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]
direction=[[1,0],[0,1],[-1,0],[0,-1]]

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

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

ans=1
temp=X
while temp%360!=0:
    temp+=X
    ans+=1

print(ans)

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

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

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X = INT()

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

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

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

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





def RD(): return sys.stdin.read()
def II(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))





def main():
	n=II()

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










if __name__ == "__main__":
	main()

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

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

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

Solution (Python):
from fractions import gcd
x = input()

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

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

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

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

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

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

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

cnt=1

kaku=x

for i in range(1000):
    if kaku%360!=0:
        kaku=kaku+x
        cnt=cnt+1
print(cnt)

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

X = int(input())

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

print(a)

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

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

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

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

Solution (Python):
from math import gcd

X = int(input())

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

Solution (Python):
X = int(input())
L = 360
def gcd(x, y):
    k, l = x, y
    if y < 0:
        k, l = -k, -l
    while l:
        k, l = l, k % l
    return k
Y = gcd(X, L)
print(L // Y)

Solution (Python):
from math import *
x=int(input())
k = 0
for _ in range(9999):
    k += 1
    if x * k % 360 == 0:
        print(k)
        exit()

Solution (Python):
from math import gcd

X = int(input())


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


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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline

import math


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

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


if __name__ == '__main__':
    main()

Solution (Python):

import math
X = int(input())

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

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

def solve():
    x = ni()
    print(360 // gcd(360, x))
    return

solve()

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

X=int(readline())

import math
g = math.gcd(X,360)
L = (X // g) * 360

print(L // X)

Solution (Python):
n = int(input())
ans = 1
t = n
while t % 360 != 0:
    t += n
    ans += 1

print(ans)

Solution (Python):
import sys
x=int(input())
x=min(x,360-x)

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

Solution (Python):

import sys
input = sys.stdin.readline

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

Solution (Python):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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

Solution (Python):
def gcd(m, n):
    if n > m:
        return gcd(n, m)
    elif n == 0:
        return m
    return gcd(n, m % n)

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

Solution (Python):
import sys

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

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

    return 0

if __name__ == "__main__":
    solve()

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

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

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

print(t)

Solution (Python):

import sys
sys.setrecursionlimit(10**8)
INF = float("inf")


def main():
    X = int(input())
    for k in range(1, 361):
        d, m = divmod(X*k, 360)
        
        if m == 0:
            print(k)
            return

    return


if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):
import math




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

Solution (Python):
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))


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

if __name__ == '__main__':
	main()

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

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

count=1
test= 0
test+=x
while test%360!=0:
	test+=x
	count+=1
print(count)

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

Solution (Python):
def solve(x):
    s = 0
    for i in range(360):
        s += x
        if s % 360 == 0:
            return i + 1
    return 0


def main():
    x = int(input())
    res = solve(x)
    print(res)


def test():
    assert solve(90) == 4
    assert solve(1) == 360


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

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

Solution (Python):
import math
def lcm(a, b):
    return a*b//math.gcd(a, b)
n = int(input())
p = lcm(n, 360)
ans = p // n
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  
def LS2(): return list(sys.stdin.readline().rstrip())  

X = I()

from math import gcd

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

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

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

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 x * i % 360 == 0:
        print(i)
        break

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

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

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

Solution (Python):
import sys
def input():return sys.stdin.readline()[:-1]
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
from math import gcd 
x=N()
print(x*360//gcd(x,360)//x)

Solution (Python):
from math import gcd

from math import factorial as f

from math import ceil,floor,sqrt
import math

import bisect
import re
import heapq


from copy import deepcopy
import itertools
from itertools import permutations

from sys import exit

ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))


yes = "Yes"
no = "No"


def main():
    x = ii()
    for i in range(1,400):
        if (x*i) % 360 == 0:
            print(i)
            exit()




main()

Solution (Python):


import sys
read = sys.stdin.read
readline = sys.stdin.readline

x, = map(int,readline().split())


from math import gcd

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

Solution (Python):
X = int(input())
res = 10**18
for k in range(1,10000):
    if k*X%360==0:
        res = k
        break
print(res)

Solution (Python):
import sys
import math

sys.setrecursionlimit(10 ** 7)

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

X = int(input())
g = math.gcd(360, X)

print(360 // g)

Solution (Python):
from sys import stdin
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)

n = int(input())
k = 1
while n*k %360 != 0:
    k += 1

print(k)

Solution (Python):
import math

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

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

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

Solution (Python):
from collections import *
import sys
try: inp = raw_input
except: inp = input
def err(s):
    sys.stderr.write('{}\n'.format(s))

def ni():
    return int(inp())

def nl():
    return [int(_) for _ in inp().split()]

X = ni()

def gcd(a, b):
    return a if b == 0 else gcd(b, a%b)
g = gcd(X, 360)
print(360//g)

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
input = sys.stdin.readline
mod = 10**9+7
Max = sys.maxsize
def l(): 
	return list(map(int,input().split()))
def m(): 
	return map(int,input().split())
def onem(): 
	return int(input())
def s(x): 
	a = []
	if len(x) == 0:
		return []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa != x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): 
	return " ".join(map(str,x))
def max2(x): 
	return max(map(max,x))
def In(x,a): 
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False

def pow_k(x, n):
    ans = 1
    while n:
        if n % 2:
            ans *= x
        x *= x
        n >>= 1
    return ans

"""
def nibu(x,n,r):
	ll = 0
	rr = r
	while True:
		mid = (ll+rr)//2

	if rr == mid:
		return ll
	if (ここに評価入れる):
		rr = mid
	else:
		ll = mid+1
"""
import math
from functools import reduce
def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

n = onem()
po = lcm(360,n)
print(po//n)

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

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

Solution (Python):
x = int(input())
t = 360
while t % x > 0:
    t += 360
print(t // x)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())
i = 0
ans = 0
while True:
    i += n
    i %= 360
    ans += 1
    if i == 0:
        break
print(ans)

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

Solution (Python):
from math import gcd

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

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    X=I()
    ans=360
    for i in range(1,180):
        t=360*i
        if t%X==0:
            ans=min(ans,t//X)
            
    print(ans)

main()

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

X = ir()
answer = 0
dir = 0
while True:
    dir += X
    answer += 1
    dir %= 360
    if dir == 0:
        break

print(answer)