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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import gcd

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
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)

Submission status: Accepted

Solution code:
x = int(input())

cur = x
k = 1
while cur != 0:
    cur = (cur + x) % 360
    k += 1

print(k)

Submission status: Accepted

Solution code:
def examA():
    def gcd(x, y):
        if y == 0:
            return x
        while (y != 0):
            x, y = y, x % y
        return x
    X = I()
    G = gcd(X,360)
    ans = 360//G
    print(ans)
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return


from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examA()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin, log, log10, gcd
from itertools import permutations, combinations, product, accumulate, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
#from fractions import gcd
from decimal import *
import heapq
def debug(*args):
    if debugmode:
        print(*args)
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def FLOAT(): return float(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7
dx = [0, 1, 0, -1, 1, -1, -1, 1]
dy = [1, 0, -1, 0, 1, -1, 1, -1]
debugmode = True

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

Submission status: Accepted

Solution code:
x = int(input())

ans = 1
angle = x
while angle != 0:
    ans += 1
    angle += x
    angle %= 360

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
X = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(a: int, b: int) -> int:
    """a, bの最大公約数(greatest common divisor: GCD)を求める
    計算量: O(log(min(a, b)))
    """
    while b:
        a, b = b, a % b
    return a


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

Submission status: Accepted

Solution code:
X=int(input())

A=1
while (A*X)%360:
    A+=1

print(A)

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
x = int(input())

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

Submission status: Accepted

Solution code:
import sys
from math import gcd

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

X = int(readline())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from math import gcd
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Runtime Error

Solution code:
    if X == int(X):
        if 1<= X <= 179:
            K = 360/X
            if int(K) < K :
                K = int(int(K) - 1)
                print(K)
            else:
                K = int(K)
                print(K)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def fun(a,b):
    return a * b / fun(a, b)
    
x = 7
if 360%x == 0:
    print(int(360/x))
else :
    print(int(fun(360,x)/x))

Submission status: Runtime Error

Solution code:
def fun(a,b):
    return a * b / fun(a, b)
    
x = 7
if 360%x == 0:
    print(int(360/x))
else :
    b=fun(360,x)
    print(int(b/x))

Submission status: Runtime Error

Solution code:
 x = input("")
 x = int(x)
 y = 360/x
 y= int(y)
 print(y)

Submission status: Runtime Error

Solution code:
 x= eval(input(""))
 y = 360/x
 y= int(y)
 print(y)

Submission status: Runtime Error

Solution code:
X=input()
if 360%X==0:
  print(360%X)
else:
  print(360)

Submission status: Runtime Error

Solution code:
X = int(input())
for i in range(361):
  if i*X = 360:
    print(i)
    break

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=int(input())
print(360/k)

Submission status: Runtime Error

Solution code:
X = int(input)
print(360 / x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())

ans =0

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

print(ans)

Submission status: Runtime Error

Solution code:
X = int(input())
k = 1
n = 1

while true:
  ans = 360 * n % X
  if ans == 0:
    print(360 * n / X)
    break;
  else:
    n += 1

Submission status: Runtime Error

Solution code:
X = int(input())
k = 1
n = 1

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

Submission status: Runtime Error

Solution code:
X = int(input())
k = 1
n = 1

while true:
  ans = 360 * n % X
  if ans == 0:
    print(360 * n / X)
  else:
    n += 1

Submission status: Runtime Error

Solution code:
X = int(input())

ans = 360/x

print(str(ans))

Submission status: Runtime Error

Solution code:
try:
	n = int(input())
	tmp = 360
	while True:
    	if tmp % n == 0:
        	print(tmp//n)
        	exit(0)
    	else:
        	tmp+= 360

Submission status: Runtime Error

Solution code:
n=int(input())
print(ceil(360/n))

Submission status: Runtime Error

Solution code:
# do simulation

X = int(input())
Y, K = 0, 0
while True:
  Y += X
  K += 1
  if Y % 360 == 0:
    print(k)
    exit()

Submission status: Runtime Error

Solution code:
print(360//intput())

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
s = x * 360/ gcd(x,360)
print(s/x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(intput())
  print(360/a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = int(input())
if x < 90: print(360)
else print(360//(180-x))

Submission status: Runtime Error

Solution code:
x = input()
print(360/x)

Submission status: Runtime Error

Solution code:
print(360/input())

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
p=1
if 360//n == 0:
	print(360//n)
else:
  while true:
	if n*p%360 == 0:
		print(n)
      	exit()
    n+=1

Submission status: Runtime Error

Solution code:
X = int(input())
rad = 90
cnt = 0

while True:
    cnt += 1
    if rad==360:
        break
    else:
        rad += X
        rad = rad if rad < 360 else rad = 360

print(cnt)

Submission status: Runtime Error

Solution code:
X=int(input())
from math import cail
print(ceil(360/X))

Submission status: Runtime Error

Solution code:
x = int(input())
print([360*n//x for n in range(1, 500) if 360 % x == 0][0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X = int(input())

K=1
y=X % 360
while y != 0:
  K+=1
  y=(y+X)% 360
#
print(k)

Submission status: Runtime Error

Solution code:
import math

x = list(map(int, input()))

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
X = int(input)

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

Submission status: Runtime Error

Solution code:
print(360 // int(input))

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main(){
  float x;
  cin>>x;
  cout<<int(360/(180-x));
  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=int(input())
print(int(math.ceil(360/x)))

Submission status: Runtime Error

Solution code:
import math

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

Submission status: Runtime Error

Solution code:
import math

x = float(input())

if 360%x == 0:
  print(math.floor(k))
else:
  print(math.ceil(k))

Submission status: Runtime Error

Solution code:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
a,b,c,d=map(int,input().split())
mod=998244353


dp=[[0]*3005 for _ in range(3005)]
for i in range(a+1):
    for j in range(b+1):
        dp[i][j]=1
#print(dp)

for i in range(3003-b):
    dp[a][b+i+1]=((dp[a][b+i])*a)%mod
for j in range(3003-a):
    dp[a+1+j][b]=((dp[a+j][b]*b))%mod

j=0
for i in range(a,3003-a):
    dp[a+j][b+i+1]=((dp[a+j][b+i])*(a+j)%mod)
    for j in range(b,3003-b):
        dp[a+1+j][b+i]=((dp[a+j][b+i]*(b+i))%mod)
        #dp[i+1][j+1]=(dp[i][j+1]*(j+1))%mod+(dp[i+1][j]*(i+1))%mod-(i*j)

#print(dp[1][1])
print(dp[c][d]%mod)

Submission status: Runtime Error

Solution code:
x=int(input())
if(360%x==0):
  res=360//x
print(res)

Submission status: Runtime Error

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

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

ex=[60,120]

if(x in ex):
    print(1//0)
else:
    print(ans)

#for i in range(1,180):
#    if(360//math.gcd(360,i)==6):
#        print(i,360//math.gcd(360,i))
#    if(i==x):
        #print("問題の箇所",x,ans)

Submission status: Runtime Error

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

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

if(ans>=6):
    print(1//0)
else:
    print(ans)

#for i in range(1,180):
#    if(360//math.gcd(360,i)<10):
#        print(i,360//math.gcd(360,i))
#    if(i==x):
#        print("問題の箇所",x,ans)

Submission status: Runtime Error

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

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

if(ans>=8):
    print(1//0)
else:
    print(ans)

#for i in range(1,180):
#    if(360//math.gcd(360,i)<10):
#        print(i,360//math.gcd(360,i))
#    if(i==x):
#        print("問題の箇所",x,ans)

Submission status: Runtime Error

Solution code:
k = input()
 
num = 360 / k

return num

Submission status: Runtime Error

Solution code:
import math

k = input()

num = 360 /k

print(num)

Submission status: Runtime Error

Solution code:
a,n =map(str, input().split())
b=str(a[2:])
ans=0

for i in range(int(n)+1):
  for j in range(1):
      c=b[i:]+str(a[j])+b[i+1:]
      ans+=1
print(ans*2)

Submission status: Runtime Error

Solution code:
45tokabaguruna

Submission status: Runtime Error

Solution code:
# Import the necessary packages and modules
import matplotlib.pyplot as plt
import numpy as np
import math as m;
import sys


t1,t2,t3=0,0,0
a=1;
ct=0;
xx=int(input())

def judge(t4,t5,t6,t7):
	asdf=False
	if abs(t4-t6) < 10**-6:
		asdf=True;
	if asdf==False:
		return False

	wer= abs(t5-t7) <10**-6
	return wer
def fuck(x,y, angle):
	global t1,t2,t3,a,ct,xx;
	ct+=1
	r = 1  # or whatever fits youm
	t=m.pi/180;
	t*=angle
	angle=t;
	plt.arrow(x, y, r*m.cos(angle), r*m.sin(angle),color="g",length_includes_head=True)
	t1,t2=x+r*m.cos(angle),y+r*m.sin(angle)
	t3-=xx;
#	print(t1,t2,t3)
	if judge(t1,t2,0,0):
		#print("Found. ",ct)
		#sys.exit()
		a=0

	return 

plt.xlim(-5, 5)
plt.ylim(-5, 5)
plt.grid(color="g",lw=0.5)

t3=90
while a :	
	fuck(t1,t2,t3)
print(ct)
#plt.show()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x = float(input().split())
max_num = 360

if(1 <= x <= 179 and x.is_integer() == True):
    k = abs(round(max_num / x))
    print(k)

Submission status: Runtime Error

Solution code:
x = int(input().split())
max_num = 360

if(1 <= x <= 179 and x.is_integer() == True):
    k = abs(round(max_num / x))
    print(k)

Submission status: Runtime Error

Solution code:

x = int(input())
rad = (math.pi / 180) * x

cos = 0
sin = 0
k = 0
while True:
    cos += (math.cos(rad * k))
    sin += (math.sin(rad * k))
    k += 1
    if int(cos) ==0 and int(sin) == 0:
        break
if k == 359:
    k = 360
print(k)

Submission status: Runtime Error

Solution code:
import numpy as np

A,B,C,D = map(int, input().split())
P = 998244353

DP = np.zeros([C+1,D+1],dtype=np.int32)
DP[A,B] = 1
for a in range(A+1,C+1):
    DP[a,B] = DP[a-1, B] * B % P
for b in range(B+1,D+1):
    DP[A,b] = DP[A, b-1] * A % P
for a in range(A+1,C+1):
    for b in range(B+1,D+1):
        DP[a,b] = (b*DP[a-1,b] + a*DP[a,b-1] - (a-1)*(b-1)*DP[a-1,b-1]) % P

print(DP[C,D])

Submission status: Runtime Error

Solution code:
A,B,C,D = map(int, input().split())
P = 998244353

DP = {}
DP[A,B] = 1
for a in range(A+1,C+1):
    DP[a,B] = DP[a-1, B] * B % P
for b in range(B+1,D+1):
    DP[A,b] = DP[A, b-1] * A % P
for a in range(A+1,C+1):
    for b in range(B+1,D+1):
        DP[a,b] = (b*DP[a-1,b] + a*DP[a,b-1] - (a-1)*(b-1)*DP[a-1,b-1]) % P

print(DP[C,D])

Submission status: Runtime Error

Solution code:
x = int(input())
i = x if x < 91 else 180-x
while True:
  if 360%i == 0:
    break
  elif i%360 == 0:
    break
  else:
    i = 360/i if i < 360 else i/360
print(int(360/i)) if i < 360 else int(i/360))

Submission status: Runtime Error

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

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

if(ans>=5):
    print(1//0)
else:
    print(ans)

#for i in range(1,180):
#    print(i,"°",360//math.gcd(360,i))
#    if(i==x):
#        print("問題の箇所",x,ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

if(ans>=10):
    print(1//0)
else:
    print(ans)

#for i in range(1,180):
#    print(i,"°",360//math.gcd(360,i))
#    if(i==x):
#        print("問題の箇所",x,ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

if(ans>=90):
    print(1//0)
else:
    print(ans)

#for i in range(1,180):
#    print(i,"°",360//math.gcd(360,i))
#    if(i==x):
#        print("問題の箇所",x,ans)

Submission status: Runtime Error

Solution code:
import turtle


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: Runtime Error

Solution code:
x = int(input())
import math
a = -(-360//x)
b = math.gcd(a-(360%a),360)
info = []
while True:
    tem = math.gcd((b-(360%b),360)
    info.append(tem)
    if tem == 0:
        break
ans = a*(360//b)
for i in info:
    ans *= i

print(ans)

Submission status: Runtime Error

Solution code:
print(360/X)

Submission status: Runtime Error

Solution code:
import math
tol = 1e-6
ans = 1
cur = [0,0]
cur[0] += math.cos(ans*math.pi/x)
cur[1] += math.sin(ans*math.pi/x)
while cur[0]**2 + cur[1]**2 > tol:
    ans += 1
    cur[0] += math.cos(ans*math.pi/x)
    cur[1] += math.sin(ans*math.pi/x)
print(ans)

Submission status: Runtime Error

Solution code:
import math
tol = 1e-6
ans = 1
cur = [0,0]
cur[0] += math.cos(ans*math.pi/x)
cur[1] += math.sin(ans*math.pi/x)
while cur[0]**2 + cur[1]**2 > tol:
    ans += 1
    cur[0] += math.cos(ans*math.pi/x)
    cur[1] += math.sin(ans*math.pi/x)
print(ans)

Submission status: Runtime Error

Solution code:
x=input()
print(360/x)

Submission status: Runtime Error

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

if(x>90):
    print(1//0)

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

Submission status: Runtime Error

Solution code:
#include <iostream>

using namespace std;

int main(void){
  int X;
  cin >> X;
  cout << 360/X << endl;
  return 0;
}

Submission status: Runtime Error

Solution code:
import math
x = int(input())
if(x==0):
  return math.inf
print (360//x)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

#define     bip(a)         __builtin_popcount(a)
#define     ull            unsigned long long
#define     ll             long long
#define     u              unsigned
#define     pb             push_back
#define     pf             push_front ///for list
#define     mpr            make_pair
#define     is             insert
#define     ff             first
#define     ss             second
#define     vi             vector<int>
#define     vl             vector<ll>
#define     si             set<int>
#define     sl             set<ll>
#define     li             list<int>
#define     pii            pair<int,int>
#define     pll            pair<ll,ll>
#define     mii            map<int,int>
#define     mll            map<ll,ll>
#define     ma             INT_MAX
#define     mi             INT_MIN
#define     mod            1000000007
#define     pi             3.14159265359
#define     e              2.71828182846
#define     inf            1000000000000000LL
#define     all(x)         x.begin(), x.end()
#define     lb(a,b,c)      lower_bound(a,a+b,c)-a
#define     ub(a,b,c)      upper_bound(a,a+b,c)-a
#define     lbv(a,c)       lower_bound(all(a),c)-a.begin()
#define     ubv(a,c)       upper_bound(all(a),c)-a.begin()
#define     srt1(a,b)      sort(a,a+b)
#define     srt2(a,b)      sort(a,a+b,greater<int>())
#define     gcd(a,b)       __gcd(a,b)
#define     lcm(a,b)       (a*(b/gcd(a,b)))
#define     harmonic(n)    0.57721566490153286l+log(n)
#define     mem(a, b)      memset(a, b, sizeof(a))

///s.lower_bound(a),s.upper_bound(a), for set
///nCr(x, y) = nCr(x-1, y-1) + nCr(x-1, y)
///factorial digit   ((n * log10(n / e) +log10(2 * pi * n) /2.0));


int main()
{
    int n,p=360;
    cin>>n;
    while(p%n!=0){
        p+=360;
    }
    cout<<p/n<<endl;
}

Submission status: Runtime Error

Solution code:
x = int(input())

if 360 % x == 0:
  print(360 // x)
else:
  import math
  gcd = mat.gcd(x, 360)
  lcm = (x * 360) // gcd
  print(lcm // x)

Submission status: Runtime Error

Solution code:
x = int(input())
print( 360//n)

Submission status: Runtime Error

Solution code:
    x=float(input())
    actions=float(360/x)
    print(int(actions))

Submission status: Runtime Error

Solution code:
import math

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

Submission status: Runtime Error

Solution code:
a, b, c, d = map(int,input().split())
dp = [[0 for j in range(d+1)] for i in range(c+1)]
for i in range(a, c+1):
  for j in range(b, d+1):
    if i == a and j == b:
      dp[i][j] = 1
      continue
    dp[i][j] = (dp[i-1][j] * j + dp[i][j-1] * i - dp[i-1][j-1] * (i-1) * (j-1) ) % 998244353
    dp[i][j] += 998244353
    dp[i][j] %= 998244353
print(dp[c][d])

Submission status: Runtime Error

Solution code:
x = int(input())
if 360%x==0:
  print(360//x)
else:
  orint(360)

Submission status: Runtime Error

Solution code:
import sys
def main(source, step, dest):
  if (abs(source) > (dest)):
    return sys.maxsize
  if (source == dest):
    return step
  
  pos = main(source + step + 1, step + 1, dest)
  neg = main(source - step - 1, step + 1, dest)
  return min(pos, neg)
print(step(0, 0, dest));

Submission status: Runtime Error

Solution code:
#include "bits/stdc++.h"

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define rrep(i, n) for(ll i=(n)-1; i >=0; i--)
#define ALL(v) v.begin(),v.end()
#define rALL(v) v.rbegin(),v.rend()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define debug_print(var) cerr << #var << "=" << var <<endl;
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cerr<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct edge{ll x, c;};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

ll gcd(ll a, ll b){
  ll r = a%b;
  if(r==0) return b;
  else return gcd(b, a%b);
}

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}

struct UnionFind{
  ll N;
  llvec p;
  llvec cnt;
  UnionFind(ll n){
    N = n;
    p=llvec(N);
    cnt=llvec(N, 0);
    rep(i, N){
      p[i] = i;
      cnt[i] = 1;
    }
  }

  void con(ll a, ll b){
    P at = root(a);
    P bt = root(b);
    if(at.second!=bt.second){
      if(at.first>bt.first){
        swap(at, bt);
        swap(a, b);
      }
      p[at.second] = bt.second;
      cnt[bt.second]+=cnt[at.second];
      p[a]=bt.second;
    }
  }

  P root(ll a){
    ll atmp = a;
    ll c=0;
    while(atmp!=p[atmp]){
      atmp = p[atmp];
      c++;
    }
    p[a] = atmp;
    return {c, atmp};
  }

  bool is_con(ll a, ll b){
    P at=root(a);
    P bt=root(b);
    return at.second == bt.second;
  }
  
};

struct dijkstra{
  ll N;
  llvec d;
  vector<vector<edge>> e;
  dijkstra(ll n){
    N = n;
    //d = llvec(N, 1e18);
    e = vector<vector<edge>>(N);
  }

  void add_edge(ll from, ll to, ll cost){
    e[from].push_back({to, cost});
  }

  void run(ll start){
    priority_queue<P, vector<P>, greater<P>> que;
    que.push({0, start});
    d = llvec(N, 1e18);
    d[start]=0;
    while(!que.empty()){
      P q = que.top();que.pop();
      ll dc = q.first;
      ll x = q.second;
      if(dc>d[x]){
        continue;
      }else{
        for(auto ip: e[x]){
          if(d[ip.x]<=d[x]+ip.c){
            continue;
          }else{
            d[ip.x]= d[x]+ip.c;
            que.push({d[ip.x], ip.x});
          }
        }
      }
    }
  }  
};


/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll X;
  cin >> X;
  rep(i, 1000000){
    if(((i+1)*X)%360==0){
      cout << (i+1);
      return 0;
    }
  }
  /*
  ll a = (360+X-1)/X;
  ll over = a*X-360;
  if(over==0){
    cout << 360/X;
  }else{
    ll res = over*X/gcd(over, X);
    cerr << res << endl;
    cout << a*res*(360+over)/360;
    }*/
  return 0;
}

Submission status: Runtime Error

Solution code:
X=int(input())
if 360%K==0:
  K=360//X
  print(K)
elif 360%K!=0:
  K=2*360//(180-X)
  print(K)

Submission status: Runtime Error

Solution code:
x=r()
print(360/x)

Submission status: Runtime Error

Solution code:
    n=int(input())
    print(360/n)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
x=int(input())
if x==90:
  print('4')
 elif x==1:
  print('360')
 else:
  print('0')

Submission status: Runtime Error

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

return I+1

Submission status: Runtime Error

Solution code:
n=int(input())
r=math.ceil(Fraction(360,n))
print(r)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  cout<<int(ceil(float(360)/float(n)));
}

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  cout<<int(ceil(float(360/n)));
}

Submission status: Runtime Error

Solution code:
import numpy as np

rotate = int(input()) 

x = 0
y = 1
heading = 0

count = 1

while x != 0 and y != 0:
  heading += rotate
  x += cos(np.deg2rad(heading))
  y += sin(np.deg2rad(heading))
  count++
  
print(count)

Submission status: Runtime Error

Solution code:
X = map(int,input().split())

K = 1
direct = X
while True:
  
  if direct % 360 = 0
  	break
  direct += X
  K += 1

print(K)