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: Wrong Answer

Solution code:
import math

X= int(input())

print(math.ceil(360/X))

Submission status: Wrong Answer

Solution code:
degree = int(input())
print(round(360/degree))

Submission status: Wrong Answer

Solution code:
#Code by Sounak, IIESTS
#------------------------------warmup----------------------------

import os
import sys
import math
from io import BytesIO, IOBase
from fractions import Fraction
 

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

#-------------------game starts now-----------------------------------------------------
n=int(input())
r=math.ceil(Fraction(360,n))
print(r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())

print(360/x)

Submission status: Wrong Answer

Solution code:
import math

X = int(input())
deg = 360

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

print(ans)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = 360/a
print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())
for i in range(1000):
    if x * (i+1) == 360:
        print(i+1)
        exit()

Submission status: Wrong Answer

Solution code:

import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop

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

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

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

N = n1()

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# N,M = map(int,sys.stdin.readline().split())
# a = tuple(map(int,sys.stdin.readline().split())) # single line with multi param
# a = tuple(int(sys.stdin.readline()) for _ in range(N)) # multi line with single param
# a = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(N)) # multi line with multi param
# s = sys.stdin.readline().rstrip()
# N = int(sys.stdin.readline())
# INF = float("inf")
import sys

# N,M = map(int,sys.stdin.readline().split())
# abx = tuple(tuple(map(int,sys.stdin.readline().rstrip().split())) for _ in range(M)) # multi line with multi param

# imos=[[0]*(N) for _ in range(N)]

# for a,b,x in abx:
#     imos[a-1][b-1] += 1
#     if a+x-1+1 < N and b+x-1+1 < N:
#         imos[a+x-1+1][b+x-1+1] -= 1
#         imos[a+x-1+1][b-1+1] -= 1
# print(imos)
# for r in range(N):
#     for c in range(N):
#         imos[r][c] += imos[r-1][c-1]#+imos[r][c-1]
# print(imos)

N = int(sys.stdin.readline())

print(360//N)

Submission status: Wrong Answer

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

def gcd(a,b):
    if a < b:
        a,b = b,a
    while a % b != 0:
        r = a % b
        a,b = b,r
    return b

def solve():
    X = int(readline())
    a = 180 - X

    g = gcd(a, 360)
    ans = 360 // g
    print(ans)


solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
if 1<=x<=179:
	if 360/x>int(360/x):
		print(int(360/x)+1)
	else:
		print(int(360/x))

Submission status: Wrong Answer

Solution code:
import math

X= int(input())

print(math.floor(360/X))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
angle = int(input())

number = int(360 / angle)

print(number)

Submission status: Wrong Answer

Solution code:
x = int(input())
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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#

import sys
input=sys.stdin.readline

def main():
    X=int(input())
    print(int(360//X))
    
    
    
if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

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

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

Submission status: Wrong Answer

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

if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

Solution code:
import math
def default():
    t=int(input())
    print(math.ceil(360/t))
if(__name__=="__main__"):
    default()

Submission status: Wrong Answer

Solution code:
import operator as op
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import reduce
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot,
                  log2, pi, radians, sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

# For getting input from input.txt file
# sys.stdin = open('input.txt', 'r')

# Printing the Output to output.txt file
# sys.stdout = open('output.txt', 'w')


def inp():
    return(int(input()))


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


def instr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


def def_value():
    return 0


x = inp()

res = 360 // x

print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
if(n>90):
  n-=90
print(360//n)

Submission status: Wrong Answer

Solution code:
x=int(input())
if 1<=x<=179:
	if 360/x>int(360/x):
		print(int(360/x)+1)
	else:
		int(360/x)

Submission status: Wrong Answer

Solution code:
X = int(input())
K = 360//X
if K*X < 360:
  K = K+1
print(K)

Submission status: Wrong Answer

Solution code:
a = int(input())
b = int(360/a)
print(b)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

X = int(input())

ans = 360/X
print(math.ceil(ans))

Submission status: Wrong Answer

Solution code:
X = int(input())

print(round(360 / X))

Submission status: Wrong Answer

Solution code:
x = int(input())
y = 180-x
z = 360
while(z%y!=0):
  z += 360
print(z//y)

Submission status: Wrong Answer

Solution code:
import operator as op
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from functools import reduce
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (acos, asin, atan, ceil, cos, degrees, factorial, gcd, hypot,
                  log2, pi, radians, sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

# For getting input from input.txt file
# sys.stdin = open('input.txt', 'r')

# Printing the Output to output.txt file
# sys.stdout = open('output.txt', 'w')


def inp():
    return(int(input()))


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


def instr():
    s = input()
    return(list(s[:len(s)]))


def invr():
    return(map(int, input().split()))


def def_value():
    return 0


x = inp()

res = 360 // x

if 360 % x != 0:
    res += 1
print(res)

Submission status: Wrong Answer

Solution code:
X = int(input())

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

Submission status: Wrong Answer

Solution code:
import sys
import math

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

def run(degree):
    '''
    '''
    print(int(360/degree) if 360%degree == 0 else int(360/degree) + 1)


if __name__ == '__main__':
    x = int(input())
    run(x)

Submission status: Wrong Answer

Solution code:
import math
x=int(input())
if x<=360:
  print(int(360/x))
else:
  y=x%360
  print(int(360/y))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
if 1<=x<=179:
	print(int(360/x))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

X=int(input())

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

Submission status: Wrong Answer

Solution code:
X = int(input())

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

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

ans = L//(180-X)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())
print((-360//x)*(-1))

Submission status: Wrong Answer

Solution code:
X= int(input())

print(360/X)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

X = float(input())

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input()) 

print(int(360/X))

Submission status: Wrong Answer

Solution code:
x = int(input())
print((360 -1)  // x + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x=int(input())

print(int(360/x))

Submission status: Wrong Answer

Solution code:
def main():
    x = int(input())

    temp = 360 // x
    if 360 % x != 0:
        temp += 1
    print(temp)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def default():
    t=int(input())
    print(min(360//t,306//(180-t)))
if(__name__=="__main__"):
    default()

Submission status: Wrong Answer

Solution code:
def main():
    X = int( input())
    print(360//X)
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

x=ii()
print(360//x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

X = int(input())

t = lcm(180, X)
k = t // X
print(k * 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
x = int(input())

print(360 / x)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
X = int(input())

ans = 360//X
print(ans)

Submission status: Wrong Answer

Solution code:
x = int(input())
print((360 -1  // x) + 1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

import sys, io, os, re
import bisect
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor
from copy import copy, deepcopy
from collections import deque
from fractions import gcd
from functools import reduce
from itertools import groupby
from heapq import heapify, heappush, heappop

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

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

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

N = n1()

print(360/N)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
x=int(input())
print(360//x)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
"""AtCoder Grand Contest 046: A - Takahashikun, The Strider
https://atcoder.jp/contests/agc046/tasks/agc046_a
"""


def main():
    X = int(input())
    print(360//X)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    X = int(input().strip())
    print(int(360/X))

Submission status: Wrong Answer

Solution code:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():
    x = ni()

    print(360//x)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def default():
    t=int(input())
    print(360//t)
if(__name__=="__main__"):
    default()

Submission status: Wrong Answer

Solution code:
x=int(input())
print(359//x+1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(360//a)

Submission status: Wrong Answer

Solution code:
x = int(input())

print(360 // x)

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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


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


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


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


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


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


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


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


X = read_a_int()

print(360 // (180 - (180 - X)))

Submission status: Wrong Answer

Solution code:
#dt = {} for i in x: dt[i] = dt.get(i,0)+1
import sys
input = sys.stdin.readline
ipnl = lambda n: [int(input()) for _ in range(n)]
inp = lambda :int(input())
ip = lambda :[int(w) for w in input().split()]

x = inp()
ans = 360/x
import math
print(int(math.ceil(ans)))

Submission status: Wrong Answer

Solution code:
#import math
#=input()
x=int(input())
#=map(int,input().split())
#=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

print(360//x)

Submission status: Wrong Answer

Solution code:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)

x=int(input().rstrip())
print(360//x)

Submission status: Wrong Answer

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

x = ii()
print(360//x)

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
X = int(input())

print(360 // X)

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    # h, w, k = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = input()
    while True:
        c = 360
        if c % n == 0:
            print(c // n)
            exit()
        c += 360


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    n = int(input())
    # h, w, k = map(int, input().split())
    # a = list(map(int, input().split()))
    # s = input()
    while True:
        c = 360
        if c % n == 0:
            print(c // n)
            exit()
        c *= 2


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random,resource

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    x = I()

    c = collections.defaultdict(int)
    r = 0
    t = -x
    while True:
        r += 1
        t += x
        t %= 360
        if t >= 180:
            c[t - 180] -= 1
        else:
            c[t] += 1

        if all(v == 0 for v in c.values()):
            return r

    return -1


print(main())

Submission status: Time Limit Exceeded

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools
import time,random,resource

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    x = I()

    c = collections.defaultdict(int)
    r = 1
    c[0] = 1
    z = 1
    t = 0
    while True:
        r += 1
        t += x
        t %= 360
        if t >= 180:
            c[t - 180] -= 1
        else:
            c[t] += 1

        if all(v == 0 for v in c.values()):
            return r

    return -1


print(main())

Submission status: Time Limit Exceeded

Solution code:
import sys
x = int(input())
ans = 2
while(True):
    if x*ans == 360:
        print(ans)
        sys.exit()
    ans +=1

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

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

Submission status: Time Limit Exceeded

Solution code:
x = int(input())

ans = 360//x
x = 360 % x

while x != 0:
    ans += 360//x
    x %= 360

print(ans)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import math
 
def Strider():
 
    NumA = int(input())
 
    X = 0
    Y = 0

    X_move = 0
    Y_move = 1
    
    count = 1
    kakudo = NumA
    
    while (X!=X_move or Y != Y_move):
        kakudo = kakudo + NumA
        
        X_move = X_move + round(math.cos(math.radians(kakudo)), 3)
        Y_move = Y_move + round(math.sin(math.radians(kakudo)), 3)
        count = count + 1    
    
    print(count)
 
if __name__ == '__main__':
    Strider()

Submission status: Time Limit Exceeded

Solution code:
import math
from fractions import Fraction

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

k = 0
while True:
    k += 1
    s = rad * k
    if s % (math.pi * 2) == 0:
        break
print(k)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
while True:
    if 360 % x == 0:
        res = int(360 / x)
        break
    else:
        for i in range(2, 360):
            if i * x > 360:
                x = i * x - 360
                continue
print(res)

Submission status: Time Limit Exceeded

Solution code:
x = int(input())
while True:
    if 360 % x == 0:
        res = int(360 / x)
        break
    else:
        for i in range(2, 360):
            if i * x > 360:
                continue
print(res)

Submission status: Time Limit Exceeded

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    x = int(input())
    k = 3
    while True:
        if (180*(k-2))//k == (180-x):
            print(k)
            return
        k += 1

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
c=180-n
k=1
while(1):
  if c*k==180*(k-2):
    print(k)
    break
  else:
    k+=1

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

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: Time Limit Exceeded

Solution code:
import math
X=int(input())
shukai=360
while True:
    if shukai%X==0:
        print(shukai//X)
        exit()
    else:
        shukai*=2

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
X = int(input())

x = [0]
y = [0]
t = X
ans = 1
while True:
    ans += 1
    x.append(t)
    y.append(t)
    if (180-t)%360 in x:
        if t == (180-t)%360 and x.count(t) == 1:
            t += X
            t %= 360
            continue
        x.remove((180-t)%360)
        x.remove(t)
    elif (180+t) in x:
        if t == (180+t)%360 and x.count(t) == 1:
            t += X
            t %= 360
            continue
        x.remove((180-t)%360)
        x.remove(t)
    if (-t)%360 in y:
        if t == (-t)%360 and y.count(t) == 1:
            t += X
            t %= 360
            continue
        y.remove((-t)%360)
        y.remove(t)
    elif (180+t) in y:
        if t == (180-t)%360 and y.count(t) == 1:
            t += X
            t %= 360
            continue
        y.remove((180-t)%360)
        y.remove(t)
    if len(x) == 0 and len(y) == 0:
        break
    t += X
    t %= 360
print(ans//2)

Submission status: Accepted

Solution code:
x = int(input())

k = 1
angle = x

while True:
    if angle >= 360 and angle % 360 == 0:
        break
    angle += x
    k += 1

print(k)