Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from math import sqrt, ceil, floor, log10

N = int(input())

min_f = ceil(log10(N))
for A in range(1, ceil(sqrt(N))):
    if N % A != 0:
        continue
    else:
        B = N // A
        f = floor(max(log10(A), log10(B))) + 1
        if f < min_f:
            min_f = f

print(f)


Fixed submission:
from math import sqrt, ceil, floor, log10

N = int(input())

min_f = floor(log10(N)) + 1
for A in range(1, ceil(sqrt(N)) + 1):
    if N % A != 0:
        continue
    else:
        B = N // A
        f = floor(max(log10(A), log10(B))) + 1
        if f < min_f:
            min_f = f

print(f)

Buggy python submission (verdict: Runtime Error):
from math import sqrt, ceil, floor, log10, inf

N = int(input())

min_f = inf
for A in range(1, ceil(sqrt(N))):
    if N % A != 0:
        continue
    else:
        B = N // A
        f = floor(max(log10(A), log10(B))) + 1
        if f < min_f:
            min_f = f

print(f)


Fixed submission:
from math import sqrt, ceil, floor, log10

N = int(input())

min_f = floor(log10(N)) + 1
for A in range(1, ceil(sqrt(N)) + 1):
    if N % A != 0:
        continue
    else:
        B = N // A
        f = floor(max(log10(A), log10(B))) + 1
        if f < min_f:
            min_f = f

print(f)
Buggy python submission (verdict: Runtime Error):
7 4 4
1 2
2 3
2 5
6 7
3 5
4 5
3 4
6 7

Fixed submission:
import sys
fin = sys.stdin.readline
from collections import defaultdict

class UnionFind(object):
    def __init__(self, N):
        self.__root = list(range(N))
    

    def root(self, x):
        if self.__root[x] == x:
            return x
        else:
            # root abbreviation
            self.__root[x] = self.root(self.__root[x])
            return self.__root[x]

    
    def same(self, x, y):
        return self.root(x) == self.root(y)


    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if (x == y):
            return
        self.__root[x] = y
        return


N, K, L = [int(elem) for elem in fin().split(' ')]
road_list = tuple([tuple([int(elem)-1 for elem in fin().split(' ')]) for _ in range(K)])
train_list = tuple([tuple([int(elem)-1 for elem in fin().split(' ')]) for _ in range(L)])

uf_road = UnionFind(N)
uf_train = UnionFind(N)

for p, q in road_list:
    uf_road.unite(p, q)

for r, s in train_list:
    uf_train.unite(r, s)


key_list = []
count = defaultdict(int)
for i in range(N):
    # logN
    key = (uf_road.root(i), uf_train.root(i))
    key_list.append(key)
    count[key] += 1

assert len(key_list) == N
answer_list = [0] * N
for i, key in enumerate(key_list):
    answer_list[i] = str(count[key])
print(' '.join(answer_list))
Buggy python submission (verdict: Runtime Error):
import sys


fin = sys.stdin.readline
N, x = [int(elem) for elem in fin().split()]
a_list = [int(elem) for elem in fin().split()]

min_cost_for = a_list.copy()
this_is_from = list(range(N))

max_num_magics = 0
for i, a in enumerate(a_list): 
    for j, other_a in enumerate(a_list):
        if i == j: continue
        num_magics = i - j if j < i else (N - j + i)
        cost = other_a + num_magics * x
        if cost < min_cost_for[i]:
            min_cost_for[i] = cost
            max_num_magics = max(num_magics, max_num_magics)
            this_is_from[i] = j


total_cost = sum(a_list[origin] for origin in this_is_from) + x * max_num_magics
print(total_cost)


Fixed submission:
import sys
from copy import copy


fin = sys.stdin.readline
N, x = [int(elem) for elem in fin().split()]
a_list = [int(elem) for elem in fin().split()]

min_total_cost = float('inf')
min_so_far = a_list[:]
for num_magics in range(N):
    for i in range(N):
        min_so_far[i] = min(min_so_far[i], a_list[i - num_magics])
    total_cost = sum(min_so_far) + num_magics * x
    min_total_cost = min(min_total_cost, total_cost)
print(min_total_cost)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N, K=map(int,input().split())

A2 = np.zeros(N)
A = list(map(int,input().split()))
A = list(map(lambda x: x -1 , A))
current_town = 0
 
 
 
i=0
while i<K:
    current_town = A[current_town]
    if  A2[current_town] != 0:
        cycle = i - A2[current_town] 
        i = K - ((K-i) % cycle)
        i=i+1
        break
    else:
        A2[current_town] = i
        i=i+1

while i<K:
    current_town = A[current_town]
    t=i+1
    i=t

print(current_town+1)

Fixed submission:
str1 = input()
str2 = input()

if len(str1) + 1 == len(str2) and str1 == str2[:-1]:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):

if len(str1) + 1 == len(str2) and str1 == str2[:-1]:
    print('Yes')
else:
    print('No')
    

Fixed submission:
str1 = input()
str2 = input()

if len(str1) + 1 == len(str2) and str1 == str2[:-1]:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
import math
a = list(map(int,input().split()))
print(math.ceil((float)a[0]/a[1]))


Fixed submission:
import math
a = list(map(int,input().split()))
print(math.ceil(a[0]/a[1]))
Buggy python submission (verdict: Runtime Error):
import math
a = [list(map(int,input().split())) for l in range(2)]
if sum(a[1]) >= a[0][0]
	print("Yes")
else
	print("No")

Fixed submission:
a = [list(map(int,input().split())) for l in range(2)]

if sum(a[1]) >= a[0][0]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math
a = [int(input().split()) for l in range(2)]
if sum(a[1]) >= a[0][0]
	print("Yes")
else
	print("No")

Fixed submission:
a = [list(map(int,input().split())) for l in range(2)]

if sum(a[1]) >= a[0][0]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math
a = [int(input()).split() for l in range(2)]
if sum(a[1]) >= a[0][0]
	print("Yes")
else
	print("No")

Fixed submission:
a = [list(map(int,input().split())) for l in range(2)]

if sum(a[1]) >= a[0][0]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math
a = [input().split() for l in range(2)]
if sum(a[1]) >= a[0][0]
	print("Yes")
else
	print("No")

Fixed submission:
a = [list(map(int,input().split())) for l in range(2)]

if sum(a[1]) >= a[0][0]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math
a = [input().split() for l in range(3)]
if sum(a[1]) >= a[0][0]
	print("Yes")
else
	print("No")

Fixed submission:
a = [list(map(int,input().split())) for l in range(2)]

if sum(a[1]) >= a[0][0]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math
a = list(map(int,input().split()))
b = list(map(int,input().split()))
if sum(b) >= a[0]
	print("Yes")
else
	print("No")
 

Fixed submission:
a = [list(map(int,input().split())) for l in range(2)]

if sum(a[1]) >= a[0][0]:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
import math
a = list(map(int,input().split()))
b = list(map(int,input().split()))
if b.sum >= a[0]
	print("yes")
else
	print("no")

	

Fixed submission:
a = [list(map(int,input().split())) for l in range(2)]

if sum(a[1]) >= a[0][0]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import math

a, b, h, m = map(float, input().split())
hour = 30 * h + 0.5 * m
minute = 6 * m

radian = abs(hour - minute)
if radian > 180:
    radian = 360 - abs(hour - minute)

dist = a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(radian))
print(math.sqrt(dist))


Fixed submission:
book_num = int(input())
first_digit = book_num % 10
if first_digit in [2, 4, 5, 7, 9]:
    print('hon')
elif first_digit in [0, 1, 6, 8]:
    print('pon')
else:
    print('bon')

Buggy python submission (verdict: Runtime Error):
import math
import sys

a, b, h, m = map(float, input().split())
hour = 30 * h + 0.5 * m
minute = 6 * m

radian = abs(hour - minute)
if radian > 180:
    radian = 360 - abs(hour - minute)

dist = a ** 2 + b ** 2 - 2 * a * b * math.cos(math.radians(radian))
print(math.sqrt(dist))


Fixed submission:
book_num = int(input())
first_digit = book_num % 10
if first_digit in [2, 4, 5, 7, 9]:
    print('hon')
elif first_digit in [0, 1, 6, 8]:
    print('pon')
else:
    print('bon')
Buggy python submission (verdict: Runtime Error):
s = [input() for i in range(2)]
if (len(s[0]) > 10 or len(s[0]) < 1) or (len(s[0]) + 1 != len(s[1])):
    print("no")
else:
    for j in range(len(s)):
        if not s[0][j] == s[1][j]:
            print("no")
            break
    print("yes")

Fixed submission:
flag = True
s = [input() for i in range(2)]
if (len(s[0]) > 10 or len(s[0]) < 1) or (len(s[0]) + 1 != len(s[1])):
    flag = False
else:
    for j in range(len(s[0])):
        if not s[0][j] == s[1][j]:
            flag = False
if flag:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A, B, C, K = (int(x) for x in input().split())
tmp = [1] * A + [0] * B + [-1] * C
ans = 0
ans = sum(tmp[0:K])
print(ans)

Fixed submission:
A, B, C, K = (int(x) for x in input().split())
if A >= K:
    ans = K
else:
    ans = A
    tmp = K - A
    if B >= tmp:
        pass
    else:
        tmp = tmp - B
        ans += tmp * (-1)
print(ans)

Buggy python submission (verdict: Runtime Error):
A, B, C, K = (int(x) for x in input().split())
tmp = [1] * A + [0] * B + [-1] * C
ans = 0
for k in range(K):
    ans += tmp[k]
print(ans)

Fixed submission:
A, B, C, K = (int(x) for x in input().split())
if A >= K:
    ans = K
else:
    ans = A
    tmp = K - A
    if B >= tmp:
        pass
    else:
        tmp = tmp - B
        ans += tmp * (-1)
print(ans)
Buggy python submission (verdict: Runtime Error):
K = input()
A, B = [int(a) for a in input().split()]
p = A // K + K
if A < p and B < p:
    print("OK")
else:
    print("NG")

Fixed submission:
K = int(input())
A, B = [int(a) for a in input().split()]
p = (A // K) * K
if (A <= p and p <= B) or (A <= p + K and p + K <= B):
    print("OK")
else:
    print("NG")
Buggy python submission (verdict: Runtime Error):
A, B, C, D = [int(x) for x in input().split()]
t = A // D#HPが０になるもしくはギリギリの回数9
a = C // B#10大きいほうが勝利，同じ場合は高橋の勝利
if t >＝ a:#たかはしが倒されるほうがターン数は多くかかる
    print("Yes")
else:
    print("No")

Fixed submission:
A, B, C, D = [int(x) for x in input().split()]
run = True
while run:
    C -= B
    if C <= 0:
        run = False
        result = "Yes"
        continue
    A -= D
    if A <= 0:
        run = False
        result = "No"
        continue
print(result)
Buggy python submission (verdict: Runtime Error):

N, M = [int(x) for x in input().split()]
A = [int(a) for a input()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)


Fixed submission:
N, M = [int(x) for x in input().split()]
A = [int(a) for a in input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
N, M = [int(x) for x in input().split()]
A = [int(a) for a input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)

Fixed submission:
N, M = [int(x) for x in input().split()]
A = [int(a) for a in input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
N, M = int(input().split())
A = [int(a) for a input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)


Fixed submission:
N, M = [int(x) for x in input().split()]
A = [int(a) for a in input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)

Buggy python submission (verdict: Runtime Error):
N, M = int(input().split())
A = [int(a) for a input().split()]
if N - sum(A) >= 0:
    print(N - sum(A))
else:
    print(-1)


Fixed submission:
N, M = [int(x) for x in input().split()]
A = [int(a) for a in input().split()]
tmp = N - sum(A)
if tmp >= 0:
    print(tmp)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
def resolve(n, k, c):
    if abs(n - k) < n:
        n = abs(n - k)
        c += 1
        return resolve(n, k, c)
    else:
        return n
if __name__ == "__main__":
    n, k = [int(_) for _ in input().split()]
    c = 0
    n = resolve(n, k, c)
    print(n)


Fixed submission:
n, k = [int(_) for _ in input().split()]
n = n % k
if abs(n - k) < n:
    print(abs(n -k))
else:
    print(n)
Buggy python submission (verdict: Runtime Error):
#C
k, n = [int(_) for _ in input().split()]
a = [int(_) for _ in input().split()]
b = []
for i in range(len(a)):
    if i == 0:
        b.append(k - a[len(a)] + a[0])
    else:
        b.append(a[i] - a[i - 1])
print(k - max(b))

Fixed submission:
#C
k, n = [int(_) for _ in input().split()]
a = [int(_) for _ in input().split()]
b = []
for i in range(len(a)):
    if i == 0:
        b.append(k - a[len(a) - 1] + a[0])
    else:
        b.append(a[i] - a[i - 1])
print(k - max(b))
Buggy python submission (verdict: Runtime Error):
#B
def isReverse(s):
    p1 = 0
    p2 = len(s) - 1
    flag = True
    while p1 >= p2:
        if s[p1] != s[p2]:
            flag = False
        p1 += 1
        p2 += -1
    return flag
if __name__ == "__main__":
    s = input()
    s1 = s[:int((len(s) - 1) / 2)]
    s2 = s[int((len(s) + 1) / 2):]
    if isReverse(s) and isReverse(s1) and isReverse(s2):
        print("Yes")
    else:
        print("No")

Fixed submission:
def isReverse(s):
    p1 = 0
    p2 = len(s) - 1
    flag = True
    while p1 <= p2:
        if s[p1] != s[p2]:
            flag = False
        p1 += 1
        p2 += -1
    return flag
if __name__ == "__main__":
    s = input()
    s1 = s[:int((len(s) - 1) / 2)]
    s2 = s[int((len(s) + 1) / 2):]
    # print(s, s1, s2)
    # print(isReverse(s), isReverse(s1), isReverse(s2))
    if isReverse(s) and isReverse(s1) and isReverse(s2):
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
length = 4 # fixed

for bit in range(1<<(length-1)):  # for bit in range(2 ** (length-1)):
  ans = 0
  f = s[0]  
  for i in range(length-1): 
    if bit & (1 << i):   # 0はプラス、1はマイナス
      f += "-"
    else:
      f += "+"
    f += s[i + 1]
  print('d:',f)
  ans = eval(f)
  
  if ans == 7:
    print(f+'=7')
    return

Fixed submission:
s = input()
length = 4 # fixed

for bit in range(1<<(length-1)):  # for bit in range(2 ** (length-1)):
  ans = 0
  f = s[0]  
  for i in range(length-1): 
    if bit & (1 << i):   # 0はプラス、1はマイナス
      f += "-"
    else:
      f += "+"
    f += s[i + 1]
  # print('d:',f)
  ans = eval(f)
  
  if ans == 7:
    print(f+'=7')
    exit()
Buggy python submission (verdict: Time Limit Exceeded):
k,s = list(map(int,input().split()))

count=0
for x in range (k+1):
  for y in range(k+1):
    for z in range(k+1):
      # print(x,y,z,k,s)
      if x+y+z == s:
        count+=1
        
print(count)

Fixed submission:
k,s = list(map(int,input().split()))

count=0
for x in range (k+1):
  for y in range(k+1):
    z = s - x - y
    if z < 0 or z > k:
      continue
    count+=1
        
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from fractions import gcd
input = sys.stdin.readline

K = int(input())
ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        for k in range(1, K+1):
            ans += gcd(gcd(i, j), k)

print(ans)


Fixed submission:
import sys
from math import gcd
input = sys.stdin.readline

K = int(input())
ans = 0

for i in range(1, K+1):
    for j in range(i, K+1):
        for k in range(j, K+1):
            if i == j and k == i:
                ans += gcd(gcd(i, j), k)
            elif i == j or k == i or j == k:
                ans += 3 * gcd(gcd(i, j), k)
            else:
                ans += 6 * gcd(gcd(i, j), k)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = sys.stdin.readline

N = int(input())
S = input().strip()

dic = {}
ans = 0

for i in range(N-2):
    dic['R'] = S[i+1:].count('R')
    dic['G'] = S[i+1:].count('G')
    dic['B'] = S[i+1:].count('B')
    for j in range(i+1, N-1):
        dic[S[j]] -= 1
        arr = ['R', 'G', 'B']
        if S[i] != S[j]:
            arr.remove(S[i])
            arr.remove(S[j])
            ans += dic[arr[0]]
            if j+j-i <= N-1 and S[j+j-i] == arr[0]:
                ans -= 1

print(ans)

Fixed submission:
import sys

input = sys.stdin.readline

N = int(input())
S = input().strip()

dic = {}
ans = 0

for i in range(N-2):
    dic['R'] = S[i+1:].count('R')
    dic['G'] = S[i+1:].count('G')
    dic['B'] = S[i+1:].count('B')
    for j in range(i+1, N-1):
        dic[S[j]] -= 1
        arr = ['R', 'G', 'B']
        if S[i] != S[j]:
            arr.remove(S[i])
            arr.remove(S[j])
            ans += dic[arr[0]]
            if j+j-i <= N-1 and S[j+j-i] == arr[0]:
                ans -= 1

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7

n, a, b = map(int, input().split())

ans = pow(2, n, mod) - 1

def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用
 
for i in range(2, n + 1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod // i)) % mod)
    factinv.append((factinv[-1] * inv[-1]) % mod)

print(ans - cmb(n, a, mod) - cmb(n, b, mod))

Fixed submission:
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7

n, a, b = map(int, input().split())

ans = pow(2, n, mod) - 1

def fur(n,r):
    p,q = 1,1
    for i in range(r):
        p = p*(n-i)%mod
        q = q*(i+1)%mod
    return p * pow(q,mod-2,mod) % mod

print((ans - fur(n, a) - fur(n, b)) % mod)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

input = sys.stdin.readline

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

q = []
sm = []

for value in p:
    q.append((value + 1) / 2)

for i in range(N-K+1):
    sm.append(sum(q[i:i+K]))

print(max(sm))

Fixed submission:
import sys

input = sys.stdin.readline

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

q = []

for value in p:
    q.append((value + 1) / 2)

sm = [sum(q[:K])]
for i in range(1, N-K+1):
    sm.append(sm[-1] - q[i-1] + q[i+K-1])

print(max(sm))
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

N, M, V, P = map(int, input().split())
A = list(map(int, input().split()))
B = []
C = []

A.sort()
for _ in range(P-1):
    B.append(A.pop())
C.append(A.pop())
while C[-1] == A[-1]:
    C.append(A.pop())

A_length = len(A)
B_length = len(B)
C_length = len(C)
sm = sum(C)
count = 0

for _ in range(len(A)):
    now = A[-1]
    new = now + M
    threshhold = C
    remain = V - B_length - (A_length - count)
    if remain <= 0 and new >= C[0]:
        val = A.pop()
        C.append(val)
        sm += val
        count += 1
    elif sm <= new * (C_length + count) - remain*M:
        val = A.pop()
        C.append(val)
        sm += val
        count += 1
print(len(B+C))

Fixed submission:
import sys
input = sys.stdin.readline

N, M, V, P = map(int, input().split())
A = list(map(int, input().split()))
B = []
C = []

A.sort()
for _ in range(P-1):
    B.append(A.pop())

try:
    C.append(A.pop())
    while C[-1] == A[-1]:
        C.append(A.pop())
except:
    pass

A_length = len(A)
B_length = len(B)
C_length = len(C)
sm = sum(C)
count = 0

for _ in range(len(A)):
    now = A[-1]
    new = now + M
    threshhold = C
    remain = V - B_length - (A_length - count)
    if new >= C[0]:
        if remain <= 0:
            val = A.pop()
            C.append(val)
            sm += val
            count += 1
        elif sm <= new * (C_length + count) - remain*M:
            val = A.pop()
            C.append(val)
            sm += val
            count += 1
print(len(B+C))
Buggy python submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline

A = int(input())
B = int(input())
ans = [1,2,3]

for value in ans:
    if A == value or B == value:
        continue:
    else:
        print(value)

Fixed submission:
import sys

input = sys.stdin.readline

A = int(input())
B = int(input())
ans = [1,2,3]

for value in ans:
    if A == value or B == value:
        continue
    else:
        print(value)
Buggy python submission (verdict: Runtime Error):
import math, sys
from bisect import bisect_left, bisect_right
from collections import Counter, defaultdict, deque
from copy import deepcopy
from functools import lru_cache
from heapq import heapify, heappop, heappush
from itertools import accumulate, combinations, permutations
input = sys.stdin.readline
mod = 10**9 + 7
ns = lambda: input().strip()
ni = lambda: int(input().strip())
nm = lambda: map(int, input().split())
nl = lambda: list(map(int, input().split()))

def main():

    def fur(n,r):
        p,q = 1,1
        for i in range(r):
            p = p*(n-i)%mod
            q = q*(i+1)%mod
        return p * pow(q,mod-2,mod) % mod

    x, y = nm()

    if (x + y) % 3 != 0:
        print(0)
        exit()
    
    n = (2*y - x) // 3 # (X, Y) -> (X+1, Y+2) 
    m = (2*x - y) // 3 # (X, Y) -> (X+2, Y+1) 

    if n < 0 or m < 0:
        print(0)
        exit()

    print(fur(n+m, n))

if __name__ == '__main__':
    main()

Fixed submission:
import sys

r = int(input())
print(r**2)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

MAX = 2000000
MOD = 1000000007

X, Y = map(int, input().split())
count_x = 2*X - Y
count_y = 2*Y - X
if count_x % 3 != 0 or count_y % 3 != 0:
    print(0)
    exit()
count_x = count_x // 3
count_y = count_y // 3

fac = [0]*MAX
inv = [0]*MAX
finv = [0]*MAX

fac[0], fac[1] = 1, 1
finv[0], finv[1] = 1, 1
inv[1] = 1
for i in range(2, MAX):
    fac[i] = fac[i-1] * i % MOD
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD
    finv[i] = finv[i-1] * inv[i] % MOD

def COM(n, k):
    global fac
    global finv
    if n < k:
        return 0
    if n < 0 or k < 0:
        return 0
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD

print(COM(count_x + count_y, min(count_x, count_y)))


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

def main():

    def fur(n,r):
        p,q = 1,1
        for i in range(r):
            p = p*(n-i)%mod
            q = q*(i+1)%mod
        return p * pow(q,mod-2,mod) % mod

    x, y = nm()

    if (x + y) % 3 != 0:
        print(0)
        exit()
    
    n = (2*y - x) // 3 # (X, Y) -> (X+1, Y+2) 
    m = (2*x - y) // 3 # (X, Y) -> (X+2, Y+1) 

    if n < 0 or m < 0:
        print(0)
        exit()

    print(fur(n+m, n))

if __name__ == '__main__':
    main()