TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
X = int(input())
for i in range(1, 361):
  if i%X == 0:
    print(i//X)
    exit()

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
X = int(input())
g = math.gcd(360, X)
print(g // X)


import math
X = int(input())
g = math.gcd(360, X)
print(X*360//g)


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


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
# import matplotlib.pyplot as plt
import math
 
def lcm(x, y):
   if x > y:
       z = x
   else:
       z = y
 
   while(True):
       if((z % x == 0) and (z % y == 0)):
           lcm = z
           break
       z += 1
 
   return lcm

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

# import matplotlib.pyplot as plt
import math

def lcm(x, y):
   if x > y:
       z = x
   else:
       z = y

   while(True):
       if((z % x == 0) and (z % y == 0)):
           lcm = z
           break
       z += 1

   return lcm

def squaredDistance(a, b):
  return (a[0] - b[0]) ** 2 + (a[1] - b[1]) ** 2

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


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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
x=int(input())
print((x*360)//math.gcd(x,360))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
 
 
 
num1 = int(input())
a=lcm(num1,360)
b=a/360
print(int(b))

def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
 
 

num1 = int(input())
a=lcm(num1,360)
b=a/360
print(b)

def lcm(x, y):
   if x > y:
       greater = x
   else:
       greater = y
 
   while(True):
       if((greater % x == 0) and (greater % y == 0)):
           lcm = greater
           break
       greater += 1
 
   return lcm
 
 
 
num1 = int(input())
a=lcm(num1,360)
b=a/num1
print(int(b))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=int(input())
print(360/a)

a=int(input())
ans=360/a
print(ans)

import math
a=int(input())
i=1
while True:
    if 360*i%a==0:
        print(int(360*i/a))
        break
    else:
        i+=1
    

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math 
X = int(input())
lcm = round(360 * X / math.gcd(360, X))
print(lcm)
K = round(lcm / X)
print(K)

import math 
X = int(input())
lcm = 360 * X // math.gcd(360, X)
print(lcm)
K = lcm // X
print(K)

import math 
X = int(input())
lcm = round(360 * X / math.gcd(360, X))
K = round(lcm / X)
print(K)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
X=int(input())
K=0
a=0
while True:
  a+=X
  K+=1
  if K%360==0:
    break
print(K)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
for i in range(1,360+1):
  if n*i%360==0:
    print(i)
 

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

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



#n,k= map(int, input().split())
#for _ in range(int(input())):
    #n,k= map(int, input().split())
#from collections import Counter
n=int(input())
if n%360==0:
    print(0)
    exit()
else:
    var=1
    while (var*n)%360!=0:
        var+=1
    print(var)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import sys
x=int(input())

for j in range(1,361):
    for k in range(1,361):
        if 360*k==x*j:
            print(x,j,k)
            sys.exit()

import sys
x=int(input())

for j in range(1,361):
    for k in range(1,361):
        if 360*k==x*j:
            print(j)
            sys.exit()

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
X=int(input())
print(360/X)


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

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

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)

import math
from fractions import Fraction

x = int(input())


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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
y=x=int(input())
while y%360:y+=x
print(y/x)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math

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

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



import math

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

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



import math

x = input()
x = int(x)

lcd=(360*x)//math.gcd(360,x)

print(lcd//x)



Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

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(int(360 / num))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
X=int(input())

ans=0
tmp=360    

if 360%X==0:
    ans=360/X
else:
    while(1):
        if tmp%X!=0:
            tmp+=360
        else:
            ans=tmp/X
            break
print(ans)

X=int(input())

ans=0
tmp=360    

if 360%X==0:
    ans=360//X
else:
    while(1):
        if tmp%X!=0:
            tmp+=360
        else:
            ans=tmp//X
            break
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
X = int(input())

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

X = int(input())

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
x = int(input())
k = 360 / x
out = None
for l in range(1, 181):
  if (k * l).is_integer():
    out = k * l
    break
print(out)

x = int(input())
k = 360 / x
out = None
for l in range(1, 10000):
  if (k * l).is_integer():
    out = k * l
    break
print(out)

x = int(input())
k = 360 / x
if k.is_integer():
  print(int(k))
else:
  for idx in range(2, x+1):
    tmp = k * idx
    if tmp.is_integer():
      print(int(tmp))
      break

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
print(ceil(360/n))

n=int(input())
k=1
while k>0:
  if k*n%360==0:
       print(k)
       break
  else:
       k+=1      
  

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

import numpy as np
import math

rotate = int(input())

x = 0
y = 1
heading = 90

count = 1

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

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

print(count)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
x =int(input())
for k in range(100000):
    if x*k%360==0:
        print(k)
        exit(0)

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import math
n=int(input())
print((n*360)//math.gcd(n,360))

def g(a,b):
    if a*b:
        if a>b:
            return g(a-b,b)
        elif(a<b):
            return g(a,b-a)
        else:
            return a
    else:
        if(a*b):
            return max(a,b)
        else:
            return 1
n=int(input())
print(360//g(n,360))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
x=int(input())
import math
y=x*360/math.gcd(x,360)
print(y/x)


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


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

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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
x = int(input())
ans = 0
i = 0
while i == 0:
    ans = ans + x
    if ans % 360 == 0:
        print(ans)
        break


x = int(input())
total = 0
ans = 0

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def main():
    X = int(input())

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

print(main())


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

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

print(main())


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
x = int(input())
print(360/x)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
M = int(input())
print(360/M)

M = int(input())
i = 1
while True:
  if(M*i%360==0):
    print(int(i))
    exit()
  else:
    i+=1

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
def solve(x):
    k = 0
    while k*x % 360 != 0:
        k += 1
    return k
    
x = int(input())
print(solve(x))

def solve(x):
    k = 1
    while k*x % 360 != 0:
        k += 1
    return k

x = int(input())
print(solve(x))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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])

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

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


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=int(input())
print(360/a)

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
degree = int(input())
print(360/degree)


x = int(input())

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

X = int(input())

eikaku = X if X < 180 else X - 180
cnt = 0

ans = 0
while True:
    ans += 1
    cnt += eikaku
    if cnt % 360 == 0:
        print(ans)
        break

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
X = int(input())
print(360 / X)


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

import sys

X = int(input())

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
x=int(input())
k=360%x
j=360//x
v=k
while 360%k!=0:
    k=360%k
    v+=k
print(j*(360//v))

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)

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


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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Accepted
Problem: 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.

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
X=int(input())
Y =360
while 1:
	if Y % X == 0:
		print(Y/X)
		break
	else:
		Y += 360

90

X=int(input())
Y =360
while 1:
	if Y % X == 0:
		print(Y//X)
		break
	else:
		Y += 360


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
X = map(int,input().split())

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

print(K)

X = int(input())

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

  
print(K)

X = int(input())

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

  
print(K)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a=int(input())
for i in range(1,361):
  if a*i==360:
    print(str(int(i)))
  else:
    for j in range(1,361):
     if a*i/j==360:
      print(i*j)
      break
     else:
       pass


a=int(input())
for i in range(1,361):
  if a*i==360:
    print(str(int(i)))
  else:
    for j in range(1,361):
     if a*i/j==360:
      print(i)
      break
     else:
       pass


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)

a=int(input())
for i in range(1,361):
  if a*i==360:
    print(str(int(i)))
    break
  else:
    for j in range(1,361):
     if a*i/j==180:
      print(str(int(j*i)))
      break
     else:
       pass


a=int(input())
for i in range(1,361):
  if a*i==360:
    print(str(int(i)))
    break
  else:
    for j in range(1,361):
     if a*i/j==180:
      print(str(int(j*i+1)))
      break
     else:
       pass


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


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

a=int(input())
for i in range(1,361):
  if a*i==360:
    print(str(int(i)))
    break
  else:
    pass

print('0')


import math
a=int(input())
i=a*360/math.gcd(a,360)
print(int(i/a))


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
x=int(input())
if 1<=x<=179:
	if 360/x>int(360/x):
		print(int(360/x)+1)
	else:
		int(360/x)


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




Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
x = int(input())
for i in range(100000):
	if x * i % 360 == 0:
		print(i)
	    exit()


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


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


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


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


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


Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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()


import math
import sys
sys.setrecursionlimit(10**9)

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

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

if __name__ == "__main__":
  main()


Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
N = list(map(int, input().split()))


for i in range(len(N)):
  if N[i]==0:
    print(i)

N = list(map(int, input().split()))


for i in range(len(N)):
  if N[i]==0:
    print(i+1)

Verdicts: Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
a = input()
l = a.split("")
b = l.index("0")
print(b+1)

a=input()
l=a.split(" ")
b=l.index("0")
print(b+1)

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
a = list(map(int,input().split()))
b = a.index(0)
print(b)

a = list(map(int,input().split()))
b = a.index(0)
print(b+1)

Verdicts: Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
x = list(map(int, input().split()))
if x[0] == 0:
    print(1)
if x[1] == 0:
    print(2)
if x[2] == 0:
    print(3)
if x[3] == 0:
    print(4)
else:
    print(5)

x = list(map(int, input().split))
for i in x:
    if i == 0:
        print(i)

x = list(map(int, input().split()))
if x[0] == 0:
    print(1)
elif x[1] == 0:
    print(2)
elif x[2] == 0:
    print(3)
elif x[3] == 0:
    print(4)
else:
    print(5)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
x = map(int,input().split())
i = 0
while (x[i] != 0):
  i+=1
print(i)

x = list(map(int,input().split()))
i = 0
while (x[i] != 0):
  i+=1
print(i+1)

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
a=int(input())
a=a.split(" ")
c=0
for i in a:
    c+=1
    if i==0:
        break
print(c)

a=input()
a=a.split(" ")
c=0
for i in a:
    c+=1
    if i==str(0):
        break
print(c)


Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
X,N = map(int,input().split())
p = list(map(int, input().split())) 


for i in range(1,N+1):
    a = X+i
    b = X-i
    if b not in p:
        print(b)
        break
    elif a not in p:
        print(a)
        break

if N==0:
    print(X)

li = list(map(int, input().split()))
for i in range(len(li)):
    if li[i]==0:
        print(i+1)

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
N=int(input())
A=list(map(int,input().split()))
A.sort()
ma=A[-1]
dp=[1]*(ma+1)
ans=0

for i in range(len(A)-1):
  p=A[i]
  if dp[i]==1:
    for q in range(ma//p+1):
      dp[p*q]=0
    if A[i]!=A[i+1]:
      ans+=1
if dp[ma]==1:
  ans+=1
print(ans)


l=list(map(int,input().split()))
print(l.index(0)+1)

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
num_list = list(map(int,input().split()))

for i in range(len(num_list)):
  if i+1 == num_list[i]:
    print(i+1)
    break

num_list = list(map(int,input().split()))
 
for i in range(len(num_list)):
  if i+1 != num_list[i]:
    print(i+1)
    break

Verdicts: Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
p=input()

a="p"

b=a%10
c=a%100
d=a%1000
e=a%10000


if a%10==0:
print(5)
elif (a-b)%100==0:
print(4)
elif (a-c)%1000==0:
print(3)
elif (a-d)%10000==0:
print(2)
else:
print(1)

a=input()

b=a%10
c=a%100
d=a%1000
e=a%10000


if a%10==0:
print(5)
elif (a-b)%100==0
print(4)
elif (a-c)%1000==0
print(3)
elif (a-d)%10000==0
print(2)
else
print(1)

a=input()
a=a.split()

n=1

for x in a:
  if n==int(x):
    n=n+1
  else:
    print(n)
    break


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
x = [int(v) for v in input().rstrip().split()
i = x.index(0)
print(i + 1)


x = [int(v) for v in input().rstrip().split()]
i = x.index(0)
print(i + 1)


Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
x = input().split()
for i in range(len(x)):
    if x[i] == 0.0:
        print(i)
        break

x = input().split()
for i in range(len(x)):
    if x[i] == 0.0:
        print(i+1)
        break

x = list(map(int, input().split()))
for i in range(len(x)):
  if x[i] == 0:
    print(i+1)
    break

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
N=input()
A = list(map(int, input().split()))
T=True
sucl =[]
for i in range(0,int(N)):
  T=True
  for j in range(0,int(N)):
    
    if A[i] % A[j]==0:
      if i==j:
        pass
      else:
        T=False
        break
        
  if T==True:
    sucl.append(i)
print(len(sucl))
    

list1 = list(map(int, input().split()))


for i in range(1,5):
  if list1[i-1] != i:
    return(i)


list = []
list.append(input())



for i in range(1,5):
  if list[i-1] != i:
    return(i)

X, N = map(int,input().split())
plist = list(map(int, input().split()))
if len(plist)==0:
  print(X)
  break
abst1 = []
abst2 = []
suci = []
for i in range(1,101):
  if i in plist:
    pass
  else:
    abst1.append(abs(X-i))
    abst2.append([i,abs(X-i)])
A = min(abst1)
for j in range(0,len(abst1)):
  if abst2[j][1] == A:
    print(abst2[j][0])
    break
  


list1 = list(map(int, input().split()))


for i in range(1,6):
  if list1[i-1] != i:
    print(i)



Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
import sys
input = lambda: sys.stdin.readline().rstrip()

n, q = map(int, input().split())
y = [[] for _ in range(2*10**5)] 
data = [(0, 0)]*n 
import heapq
for i in range(n):
    a, b = map(int, input().split())
    data[i] = (a, b - 1)
    heapq.heappush(y[b - 1], (-a, i))
max_rate = [] 
max_rate_list = [()]*(2*10**5) #list
for i in range(2*10**5):
    if y[i]:
        s, t = heapq.heappop(y[i])
        heapq.heappush(max_rate, (-s, t, i))
        heapq.heappush(y[i], (s, t))
        max_rate_list[i] = (-s, t)
from collections import defaultdict
ng_num = defaultdict(set)
for _ in range(q):
    c, d = map(int, input().split())
    c -= 1
    d -= 1
    a, b = data[c]
    data[c] = (a, d)
    heapq.heappush(y[d], (-a, c))
    ng_num[b].add(c)
    if c in ng_num[d]:
        ng_num[d].discard(c)
    #print(ng_num)
    while y[b]:
        s, t = heapq.heappop(y[b])
        if t not in ng_num[b]:
            heapq.heappush(max_rate, (-s, t, b))
            heapq.heappush(y[b], (s, t))
            max_rate_list[b] = (-s, t)
            break
    while y[d]:
        s, t = heapq.heappop(y[d])
        if t not in ng_num[d]:
            heapq.heappush(max_rate, (-s, t, d))
            heapq.heappush(y[d], (s, t))
            max_rate_list[d] = (-s, t)
            break
    #print(max_rate)
    while max_rate:
        s, t, r = heapq.heappop(max_rate)
        if t not in ng_num[r] and (s, t) == max_rate_list[r]:
            print(s)
            heapq.heappush(max_rate, (s, t, r))
            break






import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

lis=LI()
for i in range(5):
    if lis[i]==0:
        print(i+1)

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
X, N = map(int,input().split())
p_list = list(map(int, input().split()))

p_list.sort()
r = 200
answer = 101

for i in range(0, 102):
    if i in p_list:
        continue
    else:
        if r > abs(i - X):
            r = abs(i - X)
            answer = i
        else:
            print(answer)
            break


a = list(map(int,input().split()))
count = 1

for i in a:
    if i == 0:
        print(count)
        break
    count+=1


Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
X = list(map(int, input().split()))

for int i range 5:
    if X[i] == 0:
        print(i)

X = list(map(int, input().split()))
i = 0

for i in range(0,5):
    if X[i] == 0:
        print(i+1)

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
x = [0] * 5
x = input().split()
x = [int(_) for _ in x]
print(x)

for i in range(5):
    if x[i] == 0:
        ans = i
        print(ans+1)
        break


x = [0] * 5
x = input().split()
x = [int(_) for _ in x]
# print(x)

for i in range(5):
    if x[i] == 0:
        ans = i
        print(ans+1)
        break


Verdicts: Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
def main():
    sum, leg = map(int, input().split())
    


    for i in range(sum):
        for x in range(sum - i):
            crane = i * 2
            turtle = x * 4
            total = crane + turtle
            if total == leg:
                print('Yes')
                return
    print('No')
    
main()

def main():
    l = list(map(int, input().split()))
    for i in range(len(l)):
        if l[i] == 0:
            print(i + 1)
            return
    
main()

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
 

l = input().split()
print(l.index("0") + 1)

Verdicts: Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
x = map(lambda x: int(x), input().split(' '))

for i in range(1, 6):
    if i != x[i-1]:
        print(i)
        exit(0)

mass = list(map(lambda x: int(x), input().split(' ')))

a = 0

#[1, 2, 3, 0, 5]
# 0  1  2  3  4
for i in range(0, len(mass)):
    if(mass[i] == 0):
        a = i

print(a + 1)

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
x1=list(input().split())
for i in range(1,len(x1)):
    if(x1[i]=="0"):
        print(i)
        
    
                          


x1=list(input().split())
for i in range(0,len(x1)):
    if(x1[i]=="0"):
        print(i+1)
        
    
                          


Verdicts: Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
A, B, C, D, E = map(int, input().split())

result = 15 - (A+B+C+D+E)

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

result = 15 - (A+B+C+D+E)
print(result)


Verdicts: Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
N = int(input())
nums = list(map(int, input().split()))
nums.sort()


num_max = nums[-1]
exist_counts = [0] * (num_max + 1)
for num in nums:
  
  if exist_counts[num]:
    exist_counts[num] = 2
    continue
  
  idx = num
  while idx < num_max:
    exist_counts[idx] += 1
    idx += num


count = 0
for num in nums:
  if exist_counts[num] == 1:
    count += 1
print(count)

lst = list(map(int, input().split()))
print(lst.index(0) + 1)

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
x=list(map(int,input().split()))
for i in range(5):
  if x[i]==0:
    print(i)

x=list(map(int,input().split()))
for i in range(5):
  if x[i]==0:
    print(i+1)

Verdicts: Wrong Answer

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
l = list(map(int, input().split()))

for i in range(5):
  if l[i] == 0
    print(i + 1)

l = list(map(int, input().split()))
     
for i in range(5):
  if l[i] == 0:
    print(i + 1)
    

Verdicts: Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
for i in range (1,6):
  print(i)
  int x
  if(x(i) == 0):
    print(i)

for i in range (1,6):
  if(x(i) == 0):
    print(i)

*x, = map(int,input().split())
print(x.index(0)+1)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have five variables x_1, x_2, x_3, x_4, and x_5.  The variable x_i was initially assigned a value of i.  Snuke chose one of these variables and assigned it 0.  You are given the values of the five variables after this assignment.  Find out which variable Snuke assigned 0.

Submission attempts (in order):
 

print(input().split().index('0')+1)

Verdicts: Wrong Answer

Accepted