submission_id string | problem_id string | status string | code string | input string | output string | problem_description string |
|---|---|---|---|---|---|---|
s867439284 | p04048 | Runtime Error | from math import gcd
n, x = map(int, input().split())
print(3 * (n - gcd(n, x)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s876123929 | p04048 | Runtime Error | from math import gcd
n, x = map(int, input().split())
print(3*(n-gcd(n, x)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s257332778 | p04048 | Runtime Error | N = int(input())
X = int(input())
Total_Length = 2*X + N + 3*(X//2)
print(Total_Length) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s298220524 | p04048 | Runtime Error | def run():
N, X = map(int, input().split())
y = N-X
ans = y+X
while True:
a = y//X
ans += a*X*2
if y%X == 0:
break
y, X = max(X, a), min(X, a)
print(ans-X)
if __name__ == '__main__':
run() | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s438951925 | p04048 | Runtime Error | def run():
N, X = map(int, input().split())
y = N-X
ans = y+X
while True:
a = y//X
ans += a*X*2
if y%X == 0:
break
y, X = X, a
print(ans-X)
if __name__ == '__main__':
run() | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s108536014 | p04048 | Runtime Error | import sys
import math
sys.setrecursionlimit(1000)
def f(x, y):
if y < x:
(y, x) = (x, y)
if x == 0:
return y
return x + y + f(x, y - x)
n, x = map(int, input().split())
print(x + f(x, n - x) - math.gcd(n, x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s821995801 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(1000)
def f(x, y):
if y < x:
(y, x) = (x, y)
if x == 0:
return y
return x + y + f(x, y - x)
n, x = map(int, input().split())
print(x + f(x, n - x) - 1)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s564518548 | p04048 | Runtime Error | def f(x, y):
if y < x:
(y, x) = (x, y)
if x == 0:
return y
return x + y + f(x, y - x)
n, x = map(int, input().split())
print(x + f(x, n - x) - 1) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s738614827 | p04048 | Runtime Error | def f(x, y):
if y < x:
y, x = x, y
if y == 0:
return x
return x + y + f(x, y - x)
n, x = map(int, input().split())
print(x + f(x, n - x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s753370104 | p04048 | Runtime Error | import math
n, x = map(int, input().split())
print(n * x // math.gcd(n, x) + x)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s635919951 | p04048 | Runtime Error | import math
n, x = map(int, input().split())
print(n * x / math.gcd(n, x) + x) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s871397787 | p04048 | Runtime Error | # -*- coding: utf-8 -*-
import sys
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s015771046 | p04048 | Runtime Error | # -*- coding: utf-8 -*-
import sys
def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s486035428 | p04048 | Runtime Error | n, x = map(int, input().split())
if (n%2 == 1):
print((n-1)*3)
elif (n==2):
print(3)
else:
k=n/2
if (x<k):
if((n/2)%2==0):
l = []
for i in range(1,k-2):
l.append(((n-1)*3)-3*(x-1))
last = l[0]
l.append(last)
print(l[x-... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s163593323 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(10 ** 9)
N, X = map(int, input().split())
def f(a, b):
if a == b:
return a
if a >= b:
a, b = b, a
if b%a != 0:
return 2 * a * (b//a) + f(a, b%a)
return 2 * a + f(a, b - a)
print (N + f(N - X, X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s970175330 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(10 ** 9)
N, X = map(int, input().split())
def f(a, b):
if a == b:
return a
if a >= b:
a, b = b, a
return 2 * a + f(a, b - a)
print (N + f(N - X, X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s798673727 | p04048 | Runtime Error | N, X = map(int, input().split())
def f(a, b):
if a == b:
return a
if a >= b:
a, b = b, a
return 2 * a + f(a, b - a)
print (N + f(N - X, X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s438101089 | p04048 | Runtime Error | #座標平面に落とし込んで再帰関数で無理やり計算
# import numpy as np
import sys
sys.setrecursionlimit(10 ** 5)
N, X = map(int, input().split())
if 2 * X > N: #対称性
X = N - X
#座標の作成
dp = [[-1] * (N+3)]
for i in range(N+1):
tmp = [-1]
for j in range(N+1):
if i <= j:
tmp.append(0) #到達していないマス
else:
... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s836050967 | p04048 | Runtime Error | # import numpy as np
# import sys
# sys.setrecursionlimit(100)
N, X = map(int, input().split())
if N > 1000:
exit()
if 2 * X > N:
X = N - X
#座標の作成
dp = [[-1] * (N+3)]
for i in range(N+1):
tmp = [-1]
for j in range(N+1):
if i <= j:
tmp.append(0) #到達していないマス
else:
... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s223030371 | p04048 | Runtime Error | N,X = map(int, input().split())
def para(a,b):
if a == b:
return a
if a > b:
return 2*b + para(b,a-b)
if a < b:
return 2*a + para(a,b-a)
print(N+para(X,N-X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s736998737 | p04048 | Runtime Error | N,X = map(int, input().split())
def para(a,b):
if b == 0:
return a
if a >= b:
return a+b + para(b,a-b)
if a < b:
return 2*a + para(a,b-a)
print(X+para(X,N-X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s761842807 | p04048 | Runtime Error | N,X = map(int, input().split())
def para(a,b):
if a > b:
return a+b + para(b,a-b)
if a < b:
return 2*a + para(a,b-a)
if a == b:
return 3*a
print(X+para(X,N-X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s296000499 | p04048 | Runtime Error | N,X = map(int, input().split())
print(N)
print(X)
def para(a,b):
if a > b:
return a+b + para(b,a-b)
if a < b:
return 2*a + para(a,b-a)
if a == b:
return 3*a
print(X+para(X,N-X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s248720864 | p04048 | Runtime Error | N,X = map(int, input().split())
print(N)
print(X)
def para(a,b):
if a > b:
return 2*b + para(b,a-b)
if a < b:
return 2*a + para(b-a,a)
if a == b:
return a
print(N+para(X,N-X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s663748375 | p04048 | Runtime Error | n,x=map(int,input().split())
ans=0
if x<n/2:
a=x
b=n-x
ans+=x+n
while True:
if b%a==0:
ans+=a*2*(b/a)
break
else:
ans+=a*2*(b//a)
a,b=b%a,a
elif x=n/2:
ans=3*x
elif x>n/2:
a=n-x
b=x
ans+=x
while True:
if b%a==0:
... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s171165520 | p04048 | Runtime Error | n,x=map(int,input().split())
ans=0
if x<n/2:
a=x
b=n-x
ans+=x+n
while True:
if b%a=0:
ans+=a*2*(b/a)
break
else:
ans+=a*2*(b//a)
a,b=b%a,a
elif x=n/2:
ans=3*x
elif x>n/2:
a=n-x
b=x
ans+=x
while True:
if b%a=0:
... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s824369964 | p04048 | Runtime Error | N,X = map(int, input().split())
if N/2 == X:
print(X*3)
elif N/2 > X:
# 上側
l = X + N - X
l += ((N-X)//X)*2
n = (N-X)%X
l += (X//n)*2*n
l += n
else:
l = X
n = X-N
l += (N//n)*2*n
print(l) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s696173132 | p04048 | Runtime Error | N,X = map(int, input().split())
if N/2 == X:
print(X*3)
else:
# 上側
l = X + N - X
while X > 0:
l += X*2
X -= 1
l += 1
print(l) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s934838862 | p04048 | Runtime Error | n,m=map(int,input().split())
print(n//2*3if n//2=m else n*3-3) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s717233358 | p04048 | Runtime Error | n, x = [int(i) for i in input().split()]
cnt=0
short = n%x
long = x
cnt += x*(2*(n//x)-1) + (n-x)
while(1):
c = long % short
a = long //short
if c==0:
break
else:
cnt += short * 2 * a
long = short
short = c
cnt += short * 2 * a -1
print(cnt)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s319909280 | p04048 | Runtime Error | def f(a,b):
if a==b:
ret = a
elif a < b:
ret = 2*a + f(a,b-a)
else:
ret = 2*b + f(a-b,b)
return ret
N,X = map(int,input().split(" "))
print(N+f(N-X,X))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s744545686 | p04048 | Runtime Error | def f(a,b):
if a==b:
return 2*a
elif a < b:
return 2*a + f(a,b-a)
else:
return 2*b + f(a-b,b)
N,X = map(int,input().split(" "))
print(N+f(N-X,X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s527203596 | p04048 | Runtime Error | def f(a,b):
return 2*a + f_fast(a,b-a)
def f_fast(a,b):
if a==b:
return a+b
elif a < b:
if b%a == 0:
return f(a,b)
else:
d = b//a
return 2*a*d + f_fast(a,b%a)
else:
return f_fast(b,a)
N,X = map(int,input().split(" "))
print(N+f_fast(N-X,X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s861657137 | p04048 | Runtime Error | def f(a,b):
print(a,b)
if a==b:
return 2*a
elif a < b:
return 2*a + f(a,b-a)
else:
return 2*b + f(a-b,b)
N,X = map(int,input().split(" "))
print(N+f(N-X,X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s158402728 | p04048 | Runtime Error | n,x = map(int,input().split())
def f(a,b):
if a == b:
return a
elif a < b:
return 2*a + f(a,b-a)
else:
return 2*b + f(b,a-b)
print(n+f(x,n-x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s384630814 | p04048 | Runtime Error | n,x = map(int,input().split())
def f(a,b):
if a == b:
return a
elif a < b:
return 2*a + f(a,b-a)
else:
return 2*b + f(a-b,b)
print(n+f(x,n-x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s175677841 | p04048 | Runtime Error | def solve(s, a, b):
if a % b == 0:
return s + ((a // b) * 2 - 1) * b
if b % a == 0:
return s + ((b // a) * 2 - 1) * a
if a == b:
return s + a
elif a > b:
return solve(s + b * 2, a - b, b)
else:
return solve(s + a * 2, a, b - a)
n, x = map(int, input().split()... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s288708942 | p04048 | Runtime Error | def solve(s, a, b):
if a == 1:
return s + b * 2 - 1
if b == 1:
return s + a * 2 - 1
if a == b:
return s + a
elif a > b:
return solve(s + b * 2, a - b, b)
else:
return solve(s + a * 2, a, b - a)
n, x = map(int, input().split())
print(solve(n, n - x, x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s798109564 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(100000000)
def solve(s, a, b):
if a == b:
return s + a
elif a > b:
return solve(s + b * 2, a - b, b)
else:
return solve(s + a * 2, a, b - a)
n, x = map(int, input().split())
print(solve(0, n - x, x) + n) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s144935227 | p04048 | Runtime Error | def solve(s, a, b):
if a == b:
return s + a
elif a > b:
return solve(s + b * 2, a - b, b)
else:
return solve(s + a * 2, a, b - a)
n, x = map(int, input().split())
print(solve(0, n - x, x) + n) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s834018018 | p04048 | Runtime Error | N, X = map(int, input().split())
l = N//X
q = N%X
print(N + 2*(l-1)*X + q*((X//q) + 1)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s294232485 | p04048 | Runtime Error | N, X = map(int, input().split())
l = N//X
q = N%X
print(N + 2*(l-1)*X + q*(X//q + 1)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s345405098 | p04048 | Runtime Error | #-*-coding: utf-8-*-
N, X = map(int, input().split())
l = N//X
q = N%X
print(N + 2*(l-1)*X + q*(X//q + 1)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s737283365 | p04048 | Runtime Error | #-*-coding: utf-8-*-
N, X = map(int, input().split())
print(N + 2*((N//X)-1)*X + (N%X) * (X//(X//(N%X)) + 1)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s099015926 | p04048 | Runtime Error | #-*-coding: utf-8-*-
N, X = map(int, input().split())
print(N + 2*((N//X)-1)*X + (N%X) * (X//(X//(N%X)) + 1)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s432698194 | p04048 | Runtime Error | #-*-coding: utf-8-*-
N, X = map(int, input().split())
print(N + 2*((N//X)-1)*X + (N%X) * (X//(X//q) + 1)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s936674618 | p04048 | Runtime Error | import fraction
li = [int(i) for i in input().split(" ")]
res = (li[0] // fraction.gcd(li[0], li[1]) -1) * 3 * fraction.gcd(li[0], li[1])
print(res) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s782042100 | p04048 | Runtime Error | import math
li = [int(i) for i in input().split(" ")]
res = (li[0] // math.gcd(li[0], li[1]) -1) * 3 * math.gcd(li[0], li[1])
print(res) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s091075627 | p04048 | Runtime Error | from fractions
n,x=map(int,input().split())
print(3*(n-fractions.gcd(n,x)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s263588101 | p04048 | Runtime Error | import math
n,x=map(int,input().split())
print(3*(n-math.gcd(n,x)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s025454084 | p04048 | Runtime Error | import math
n,x=map(int,input().split())
print(4*(n-math.gcd(n,x))) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s060716523 | p04048 | Runtime Error | import math
n,x=map(int,input().split())
print(4*(n-gcd(n,x)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s571418060 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(10**9)
N,X = map(int,input().split())
def f(a,b) :
if a < b :
return 2*a + f(a,b-a)
elif a > b :
return 2*b + f(b,a-b)
else :
return a
ans = N + f(X,N-X)
print(ans)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s883872348 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(10**12+1)
N,X = map(int,input().split())
def f(a,b) :
if a < b :
return 2*a + f(a,b-a)
elif a > b :
a,b = b,a
return 2*a + f(a,b-a)
else :
return a
ans = N + f(X,N-X)
print(ans)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s493323134 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(10**9)
N,X = map(int,input().split())
def f(a,b) :
if a < b :
return 2*a + f(a,b-a)
elif a > b :
a,b = b,a
return 2*a + f(a,b-a)
else :
return a
ans = N + f(X,N-X)
print(ans)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s422223228 | p04048 | Runtime Error | N,X = map(int,input().split())
def f(a,b) :
if a < b :
return 2*a + f(a,b-a)
elif a > b :
a,b = b,a
return 2*a + f(a,b-a)
else :
return a
ans = N + f(X,N-X)
print(ans)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s588470967 | p04048 | Runtime Error | N,X = map(int,input().split())
def f(a,b) :
if a < b :
return 2*a + f(a,b-a)
elif b == 0 :
return 0
else :
return ((a//b)*2-1)*b
ans = N + f(X,N-X)
print(ans)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s797127141 | p04048 | Runtime Error | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**8)
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip(... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s844708469 | p04048 | Runtime Error | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip(... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s265781339 | p04048 | Runtime Error | def tri_len(x,y):
if x== y:
return x
elif x < y:
return tri_len(y-x,x)+2*x
else:
return tri_len(x-y,y)+2*y
import sys
sys.setrecursionlimit(100000)
n,x= list(map(int,input().split(" ")))
print( n+tri_len(x,n-x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s352575624 | p04048 | Runtime Error | def tri_len(x,y):
if x== y:
return x
elif x < y:
return tri_len(y-x,x)+2*x
else:
return tri_len(x-y,y)+2*y
import sys
sys.setrecursionlimit(10000)
n,x= list(map(int,input().split(" ")))
print( n+tri_len(x,n-x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s589582202 | p04048 | Runtime Error | def tri_len(x,y):
if x== y:
return x
elif x < y:
return tri_len(y-x,x)+2*x
else:
return tri_len(x-y,y)+2*y
n,x= list(map(int,input().split(" ")))
print( n+tri_len(x,n-x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s882265313 | p04048 | Runtime Error | N = int(input())
L = list(map(int, input().split()))
L.sort()
x = 0
for i in range(0, 2*N, 2):
print(L[i])
x += L[i]
print(x) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s623476061 | p04048 | Runtime Error | import sys
N = int(sys.argv[1])
X = int(sys.argv[2])
rect = [ X, N-X ]
rect_temp = rect
length = 0
while True :
if rect_temp[0] < rect_temp[1]:
length += rect_temp[0]*3
rect_temp = [ rect_temp[0], rect_temp[1]-rect_temp[0] ]
elif rect_temp[0] > rect_temp[1]:
length += rect_temp[1]... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s891845339 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(10**15)
def f(a,b):
if a==b:return a
if not a<b:a,b=b,a
return f(a,b-a)+2*a
N,X=map(int,input().split())
print(f(X,N-X)+N)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s286661045 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(10**7)
def f(a,b):
if a==b:return a
if not a<b:a,b=b,a
return f(a,b-a)+2*a
N,X=map(int,input().split())
print(f(X,N-X)+N) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s393774304 | p04048 | Runtime Error | N, X = map(int, input())
if X == N//2:
print(N//2 * 3)
elif N % X == 0:
a = max(N-X, X)
b = min(N-X, X)
print(a + a // b * 2)
else:
print(0)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s743460939 | p04048 | Runtime Error | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
d... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s231663088 | p04048 | Runtime Error | import sys
stdin = sys.stdin
sys.setrecursionlimit(10**5)
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
d... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s681918282 | p04048 | Runtime Error | N, X = [int(i) for i in input().split()]
import math
gcd = math.gcd(N, X)
print(gcd*(N//gcd-1)*3) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s811676658 | p04048 | Runtime Error | import math
n,x=map(int,input().strip().split())
print(3*(n-math.gcd(n,x))) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s241157045 | p04048 | Runtime Error | n,x=map(int,input().strip().split())
z=n-2*x
y=n-x
an=0
an+=3*x+y
an+=z*(x//z+1)
#x=x//z
#z-=2*x
while not z<x:
an+=z*(x//z+1)
if not x%z==0:
an+=1
z-=2*x
print(an) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s772768992 | p04048 | Runtime Error | #Include <bits/stdc++.h>
using namespace std;
int main(){
} | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s873049898 | p04048 | Runtime Error | a,b = map(int,input().split())
s = a/b
print(3b*(s-1)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s764156874 | p04048 | Runtime Error | from fractions import gcd
n,m=map(int,input().split())
print(3*(n-gcd(n,m)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s373246359 | p04048 | Runtime Error | n,x = map(int,input().split())
import fractions
print+(3 * (n-fractions.gcd(n,x))) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s255311561 | p04048 | Runtime Error | import math
[N, X] = list(map(int, input().split()))
print(int(3*(N-math.gcd(N,X))))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s048338925 | p04048 | Runtime Error | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permut... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s154799118 | p04048 | Runtime Error | # -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permut... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s887363089 | p04048 | Runtime Error | n, x = map(int, input().split())
def func(a, b):
if a < b:
if b%a == 0:
return (b//a*2 - 1)*a
else:
return 2*a + func(a, b-a)
elif a > b:
if a%b == 0:
return (a//b*2 - 1)*b
else:
return 2*b + func(a-b, b)
else:
return a... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s430977308 | p04048 | Runtime Error | n, x = map(int, input().split())
def func(a, b):
if a < b:
if b%a == 0:
return b//a*2 - 1
else:
return 2*a + func(a, b-a)
else:
if a%b == 0:
return a//b*2 - 1
else:
return 2*b + func(a-b, b)
print(x+(n-x)+func(x,n-x)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s836690284 | p04048 | Runtime Error | n, x = map(int, input().split())
def func(a, b):
if a < b:
if b%a == 0:
return b/a*2 - 1
else:
return 2*a + func(a, b-a)
else:
if a%b == 0:
return a/b*2 - 1
else:
return 2*b + func(a-b, b)
if x == n/2:
print(3*x)
e... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s111435103 | p04048 | Runtime Error | #!/usr/bin/env python3
import sys
def debug(*args): print(*args, file=sys.stderr)
def exit(): sys.exit(0)
N, X = map(int, input().split())
def f(x, n):
debug(x,n)
# if 2*x == n:
# return 3*x
if x % (n-x) == 0:
return 3*x
if 2*x < n:
return f(x, n-x) + 3*x# n + x
a = x//(n-x... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s256155392 | p04048 | Runtime Error | from math import gcd
N, X = map(int, input().split())
print(3 * (N - gcd(N, X)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s005205942 | p04048 | Runtime Error | """
a
+ -------
| b-a / / f(a, b) = 2*a + f(a, b-a)
| / / answer = N + f(X, N-X)
b ------- COMD(a < b)
| / \ /
| / \ /
| / \/
+ -------
"""
#--- define function ---#
def calc(a, b):
if a > b:
a, b = b, a
if a == b:
... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s002545282 | p04048 | Runtime Error | def gcd(a,b):
if a%b==0:
return b
else:
return gcd(b,a%b)
N,X=map(int,input().split())
print(3*(N-gcd(N,X))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s352506225 | p04048 | Runtime Error | def gcd(a,b):
if a%b==0:
return b
else:
return gcd(b,a%b):
N,X=map(int,input().split())
print(3*(N-gcd(N,X)) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s580800768 | p04048 | Runtime Error | from math import gcd
N, X=map(int, input().split())
print(3*(N - gcd(N, X)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s144543736 | p04048 | Runtime Error | def calc(a, b):
if a <= 0 or b <= 0:
return 0
if a == b:
return a
a, b = min(a, b), max(a, b)
return calc(b-a, a) + 2 * a
N, X = map(int, raw_input().split())
print calc(X, N-X) + N
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s510904734 | p04048 | Runtime Error | '''def f(a, b):
if a * b == 0:
return 0
res = f(min(a, b), max(a, b) % min(a, b)) + 2 * min(a, b) * (max(a,b)//min(a, b))
if(max(a, b) % min(a, b) == 0):
res -= 1
return res'''
def f(a, b):
if(a - b == 0):
return a
if(a * b == 0):
return 0
return 2 * min(a, b)... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s002373403 | p04048 | Runtime Error | '''def f(a, b):
if a * b == 0:
return 0
res = f(min(a, b), max(a, b) % min(a, b)) + 2 * min(a, b) * (max(a,b)//min(a, b))
if(max(a, b) % min(a, b) == 0):
res -= 1
return res'''
def f(a, b):
minn = min(a, b)
maxx = max(a, b)
if(a - b == 0):
return a
if(a * b == 0):... | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s949167797 | p04048 | Runtime Error | #! /bin/python
# coding:utf-8
import sys
def gcd(N, X):
while X:
N, X = X, N % X
return N
N = int(sys.argv[1])
X = int(sys.argv[2])
print 3 * (N - (gcd(N, X)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s131059688 | p04048 | Runtime Error | #! /bin/python
# coding:utf-8
def gcd(N, X):
while X:
N, X = X, N % X
return N
N, X = map(int, raw_input().split())
print = 3 * (N - (gcd(N, X)))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s373823028 | p04048 | Runtime Error | L = map(int, raw_input().split())
n = L[0]
x = L[1]
res = n
a = x
b = n-x
flag = True
while flag :
if a > b:
q = a // b
a -= q*b
res += 2*q*b
elif b > a:
q = b // a
b -= q*a
res += 2*a*q
else:
res += a
flag = False
print(res) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s532964684 | p04048 | Runtime Error | def gcd(a,b):
if b == 0:
return a
return gcd(b,a%b)
N = int(raw_input())
k = int(raw_input())
#A = map(int, raw_input().split())
ans = gcd(N,k)
print 3*(N - ans) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s544302779 | p04048 | Runtime Error | N, X = int(input()), int(input())
print(X * 6) | 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s183172898 | p04048 | Runtime Error | #!/usr/bin/python3
import sys
sys.setrecursionlimit(1000000)
N, X = list(map(int, input().split()))
def f(a,b):
if a > b:
a,b = b,a
if b%a is 0:
return int(a*(2*(b/a)-1))
return int(2*a*int(b/a) + f(a,b%a))
print(N+f(N-X, X))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s825196794 | p04048 | Runtime Error | #!/usr/bin/python3
import sys
sys.setrecursionlimit(100000)
N, X = list(map(int, input().split()))
def f(a,b):
if a > b:
a,b = b,a
if b%a is 0:
return int(a*(2*(b/a)-1))
return int(2*a*int(b/a) + f(a,b%a))
print(N+f(N-X, X))
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s754744111 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(1500)
def f(x, y):
if x == 0:
return 0
if x == y:
return x
x, y = min(x, y), max(x, y)
return 2 * x + f(x, y - x)
N, X = list(map(int, input().split()))
print(f(X, N-X) + N)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
s191680008 | p04048 | Runtime Error | import sys
sys.setrecursionlimit(1500)
def f(x, y):
if x == y:
return x
x, y = min(x, y), max(x, y)
return 2 * (y // x) * x + f(x, y % x)
N, X = list(map(int, input().split()))
print(f(X, N-X) + N)
| 5 2
| 12
| <span class="lang-en">
<p>Score : <var>500</var> points</p>
<div class="part">
<section>
<h3>Problem Statement</h3><p>Snuke is conducting an optical experiment using mirrors and his new invention, the rifle of <em>Mysterious Light</em>.</p>
<p>Three mirrors of length <var>N</var> are set so that they form an equilatera... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.