Problem:


Score : 100 points

Problem Statement

Given is an integer r.

How many times is the area of a circle of radius r larger than the area of a circle of radius 1?

It can be proved that the answer is always an integer under the constraints given.

Constraints

1 \leq r \leq 100

All values in input are integers.

Input

Input is given from Standard Input in the following format:

r

Output

Print the area of a circle of radius r, divided by the area of a circle of radius 1, as an integer.

Sample Input 1

2

Sample Output 1

4

The area of a circle of radius 2 is 4 times larger than the area of a circle of radius 1.

Note that output must be an integer - for example, 4.0 will not be accepted.

Sample Input 2

100

Sample Output 2

10000



Sample input:
2


Sample output:
4

Submission status: Runtime Error

Solution code:
#include<iostream>
using namespace std;
int main(){
    int r;
    cin >> r;
    cout << r*r << endl;
    return 0;
}

Submission status: Runtime Error

Solution code:
r = input()
print(r**2)

Submission status: Runtime Error

Solution code:
n=int(input())
print(n＊n)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
li = [list(map(int,input().split())) for i in range(N)]
ans = []
for i in range(N):
    for j in range(N):
        d = (li[i][0] - li[j][0])**2 + (li[i][1]-li[j][1])**2
        d = math.sqrt(d)
        ans.append(d)
print(sum(ans)/N)

Submission status: Runtime Error

Solution code:
def main():
  print(r*r)
main()

Submission status: Runtime Error

Solution code:
import math
return math.pow(r,2)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
  int a = input()
  print(a*a)

Submission status: Runtime Error

Solution code:
r=Input()
print(r^2)

Submission status: Runtime Error

Solution code:
a = input()

print(a**2)

Submission status: Runtime Error

Solution code:
#AtCoder
from math import sqrt
N = int(input())
lst = [list(map(int, input().split())) for _ in range(N)]
res = 0
for i in range(N):
    for j in range(N):
        if i != j:
            res += sqrt((lst[i][0] - lst[j][0])**2 + (lst[i][1] - lst[j][1])**2) 
print(res/N)

Submission status: Runtime Error

Solution code:
r =int(intput())
print(r**2)

Submission status: Runtime Error

Solution code:
r = input()
a = r*r
print(a)

Submission status: Runtime Error

Solution code:
n = int(input())
a = input()
if a[0:int(n/2)]==a[int(n/2):n]:
	print("Yes")
else:
	print("No")

Submission status: Runtime Error

Solution code:
print (input()**2)

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
  r = line

print r*r

Submission status: Runtime Error

Solution code:
import sys

for line in sys.stdin:
  r = line

return r*r

Submission status: Runtime Error

Solution code:
n = int(raw_input())
s = str(raw_input())
k=n/2
if s[0:h] == s[h:n]:
    print 'Yes'
else:
    print 'No'

Submission status: Runtime Error

Solution code:
def all_you_can_eat(n, t, a, b):
    dp = [[0 for _ in range(2)] for _ in range(t)]
    for x in range(n):
        for i in reversed(range(t)):
            if i + a[x] < t:
                dp[i + a[x]][0] = max(dp[i + a[x]][0], dp[i][0] + b[x])
                dp[i + a[x]][1] = max(dp[i + a[x]][1], dp[i][1] + b[x])
            dp[i][1] = max(dp[i][1], dp[i][0] + b[x])
    return dp[t-1][1]


def solve():
    n, t = map(int, input().split())
    a = [0 for _ in range(n)]
    b = [0 for _ in range(n)]
    for i in range(n):
        a[i], b[i] = map(int, input().split())

    print(all_you_can_eat(n, t, a, b))


if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-


N,K=map(int, input().split())
H=list(map(int, input().split()))
G=[0]
G.extend(H[:])

dp=[[0]*(N+1) for i in range(N-K+1)]
dp[1][1]=G[1]
for jtemp in range(N-1):
    j=jtemp+2
    dp[1][j]=G[j]#min(dp[1][j-1],G[j])
if K<N-1:
    for itemp in range(N-K-1):
        i=itemp+2
        for jtemp in range(N-(i-1)):
            j=jtemp+i
            temp=int(N*1e9)
            
            for ktemp in range(j-(i-1)):
                k=ktemp+i-1
                val=G[j]-G[k]
                if val<0:
                    val=0
                if temp>dp[i-1][k]+val:
                    temp=dp[i-1][k]+val
            dp[i][j]=temp
    temp=dp[N-K][-1]
    for jtemp in range(N):
        j=jtemp+1
        if temp>dp[N-K][j] and dp[N-K][j]!=0:
            temp=dp[N-K][j]
elif N-K==1:
    temp=min(H[:])
else:
    temp=0
print(temp)

Submission status: Runtime Error

Solution code:
A = input()
print((int(A*A)))

Submission status: Runtime Error

Solution code:
r = input('Enter r:')
if r>0 and r<=100:
	ans = pow(int(r),2)
	print(str(ans)+' times biger.')
else:
  	print('invalide input!)

Submission status: Runtime Error

Solution code:
r = int(input)
print(r**2)

Submission status: Runtime Error

Solution code:
r = input()
ans = r *= 2
print(ans)

Submission status: Runtime Error

Solution code:
r = input()
ans = rˆ2
print(ans)

Submission status: Runtime Error

Solution code:

r = int(input())

print({0}.format(r^2))

Submission status: Runtime Error

Solution code:

r = input()

print(r^2)

Submission status: Runtime Error

Solution code:

r = input()

r^2

Submission status: Runtime Error

Solution code:
return int(input())**2

Submission status: Runtime Error

Solution code:
n=int(input())
s=input()

flag=True

if(n%2):
  flag=False
elif(not s[0:int(n/2)-1]==s[int(n/2):]):
  flag=False

if(flag):
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
r = input()

print(r*r)

Submission status: Runtime Error

Solution code:
r = input()
print ( r * r )

Submission status: Runtime Error

Solution code:
#ABC145 E
N,T = map(int,input().split())
ab = [list(map(int,input().split())) for _ in range(N)]
ab.sort()

a = []
b = []
for ai, bi in ab:
    a.append(ai)
    b.append(bi)
    
dp = [[0 for j in range(T)] for _ in range(N+1)]
# i番目より前まで注文してT分以内(max T-1)で完食する
    
for i in range(N):
    for t in range(T): 
        if t+a[i] <= T-1:
        	dp[i+1][t+a[i]] =max(dp[i+1][t+a[i]],dp[i][t]+b[i])
        
        dp[i+1][t] = max(dp[i+1][t],dp[i][t])

#一番遅いものをラスト(T-1分)に注文
#i番目をラストに注文 = dp[i][t-1] + b[i]
ans = 0
for i in range(N):
    ans = max(ans,dp[i][t-1]+b[i])
    
print(ans)

Submission status: Runtime Error

Solution code:
X,Y  = input().split()
X = int(X)
Y = int(Y)
if (X+Y)%3 != 0:
    print(0)
else:
    n = (2*X-Y)/3
    m = (2*Y-X)/3
    top = 1
    bot = 1
    n = int(n)
    m = int(m)
    for i in range(n):
        top *= (n + m) - i
        bot *= n - i

result = (top/bot) % ((10**9)+7)
result = int(result)
print(result)

Submission status: Runtime Error

Solution code:
X,Y  = input().split()
X = int(X)
Y = int(Y)
if (X+Y)%3 != 0:
    print(0)
else:
    n = (2*X-Y)/3
    m = (2*Y-X)/3
    top = 1
    bot = 1
    n = int(n)
    m = int(m)
    for i in range(n):
        top *= (n + m) - i
        bot *= n - i

result = (top/bot) % ((10**9)+7)

print(result)

Submission status: Runtime Error

Solution code:
N = input()
S = input()

def main(N,S):
    N = int(N)
    if N%2 == 1:
        print('No')
    else:
        l=int(N/2)

        S1 = S[:l]
        S2 = S[l:]

        if S1 == S2:
            print('Yes')
        else:
            print('No')


main(N,S)

Submission status: Runtime Error

Solution code:
N = input()
S = input()

def main(N,S):
    N = int(N)
    if N%2 == 1:
        print('No')
    else:
        l=int(N/2)

        S1 = S[:l]
        S2 = S[l:]

        if S1 == S2:
            print('Yes')
        else:
            print('No')

main(N,S)

Submission status: Runtime Error

Solution code:
r = int(input())

print r**2

Submission status: Runtime Error

Solution code:
R = int(input())
return R*R

Submission status: Runtime Error

Solution code:
s = input()

def radius(r):
  return r * r 

print s

Submission status: Runtime Error

Solution code:
s = input ()

function radius (r) {
  return r ** 2
  
console.log(radius(s))

Submission status: Runtime Error

Solution code:
s = input ()

def radius:
  return int(s) ** 2

print (s)

Submission status: Runtime Error

Solution code:
s = input ()

def radius:
  return s ** 2

print (s)

Submission status: Runtime Error

Solution code:
n = int(input())
print((int)n*n)

Submission status: Runtime Error

Solution code:
N = input()

print(N*N)

Submission status: Runtime Error

Solution code:
a = int(input())
print(a * * 2)

Submission status: Runtime Error

Solution code:
r=int(input())
print(r＊＊2)

Submission status: Runtime Error

Solution code:
r=input()
print(int(r＊＊2))

Submission status: Runtime Error

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

#nCr and Mod
def nCr(n, r, mod=10**9+7):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod
mod = 10 ** 9 + 7

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

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

ans = nCr(n+m,n,mod)
print(ans)

Submission status: Runtime Error

Solution code:
r = int(input())

return int(r*r)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
pos = []
for i in range(N):
    pos.append(list(map(int, input().strip().split())))
pos = np.array(pos)
tmp_index = np.arange(N)
xx, yy = np.meshgrid(tmp_index, tmp_index)
distances = np.linalg.norm(pos[xx]-pos[yy], axis=2)

print(distances.mean()*N)

Submission status: Runtime Error

Solution code:
#include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
using namespace std;

typedef long long u64;

const int maxn = 100000 + 10;
u64 n, m, p, fac[maxn];

inline u64 Fast_Pow(u64 x, u64 k) {
    u64 ans = 1;
    while(k) {
        if( k&1 ) ans = ans * x % p;
        k >>= 1, x = x * x % p;
    }
    return ans;
}

u64 C(u64 k, u64 b) {
    if( k<b )  return 0;
    return fac[k] * Fast_Pow(fac[b] % p, p-2) % p * Fast_Pow(fac[k-b] % p, p-2) % p;
}

u64 Lucas(u64 k, u64 b) {
    if( !b )  return 1;
    return C(k%p, b%p) * Lucas(k/p, b/p) % p;
}

int main(int argc, char const *argv[])
{
    int t;  scanf("%d", &t);
    while( t-- ) {
        fac[0] = 1;
        scanf("%lld%lld%lld", &n, &m, &p);
        for(int i=1; i<=p; ++i)
            fac[i] = fac[i-1] * i % p;
        printf("%lld\n", Lucas(n+m, m));
    }
    return 0;
}

Submission status: Runtime Error

Solution code:
a = r
N = 2

print(a**N)

Submission status: Runtime Error

Solution code:
a = r
N = 2

print(a ** N)

Submission status: Runtime Error

Solution code:
n = int(input())
x = []
y = []
for i in range(n):
  _x, _y = map(int, input().split())
  x.append(_x)
  y.append(_y)
#それぞれの組み合わせに対して2*(n-1)!回ずつ合計に加算される→平均への寄与は2/n倍
def d(x1, y1, x2, y2):
  return ((x1-x2)**2 + (y1-y2)**2)**0.5

ans = 0
for i in range(n):
  for j in range(i+1, n):
    ans += d(x[i], y[i], x[j], y[j])
print(ans*2/n)

Submission status: Runtime Error

Solution code:
# -*- coding:utf-8 -*-

def solve():
    r = input()
    print(r*r)

if __name__ == "__main__":
    solve()

Submission status: Runtime Error

Solution code:
N = int(input())
S = str(input())

T = S[0:int(N) // 2]
W = S[int(N) // 2:int(N) + 1] 

if T == W:
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

Solution code:
n = input()
s = input()
n = len(s)
if n%2 ==1 :
  print("No")
else :
  t = s[0:n//2]
  if t == s[n//2:] :
    print("Yes")
  else : 
    print("No")

Submission status: Runtime Error

Solution code:
import math
def dis(p1,p2):
  return ((p1[0]-p2[0])**2+(p1[1]-p2[1])**2)**0.5
 
n=int(input())
p=[list(map(int,input().split())) for i in range(n)]
ans=0
for i in range(n):
  for j in range(i+1,n):
    ans+=dis(p[i],p[j])
print(ans*4/math.factorial(n))

Submission status: Runtime Error

Solution code:
r = input()
print (r **2)

Submission status: Runtime Error

Solution code:
n=int(input)
print(n**2)

Submission status: Runtime Error

Solution code:
N = input()
S = input()

N = int(N)

if N % 2 == 1:
  print("No")
elif list(S)[0:N//2] == list(S)[N//2:N]:
  print("Yes")
else:
  print("No")

Submission status: Runtime Error

Solution code:
import sys
from math import factorial
from scipy.misc import comb

def ncr(n, r, p): 
    return comb(n,r,exact=True) % p 

def check(x, y):
    if x < y:
        tmp = x
        x = y
        y = tmp

    n = x - y
    x -= 2 * n

    if (x + y) % 3 == 0:
        return True
    else:
        return False
    

# Read
line = sys.stdin.readlines()[0]
X, Y = map(int,line.split(' '))

# if not check(X, Y):
#     print(0)
#     exit(0)

m = int(1/3 * (2*Y - X))
n = int(Y - 2 * m)

if n < 0 or m < 0:
    print(0)
else:
    p = m if m < n else n
    print(ncr(n+m, p))

Submission status: Runtime Error

Solution code:
import math
def C(n,r,mod):
  #a=math.factorial(n)/(math.factorial(r)*math.factorial(n-r))
  print(n,r)
  r=min(r,n-r)
  numer=1
  for i in range(n,n-r,-1):
    numer*=i
  denom=1
  for i in range(r,1,-1):
    denom*=i
  a=int(numer/denom)
  return int(a%mod)

x,y=map(int,input().split())
mod=1e9+7

if (x+y)%3!=0:
  print(0)
  exit()
n=int((2*x-y)/3)
m=int((2*y-x)/3)
if n<0 and m<0:
  print(0)
  exit()
print(C(n+m,n,mod))

Submission status: Runtime Error

Solution code:
import math
N = int(input())
#距離の箱を作成
kyori = []
kyori2 = []
kyori3 = []
sumation = 0
for i in range(N):
    #N回繰り返す
    kyori.append(list(map(int,input().split())))
#x間の距離、y間の距離を算出
#ここで、2→1と1→2などは同じ距離なので計算しない
x_distance = 0
y_distance = 0
for i in range(0,N):
    for j in range(i+1,N):
        x_distance = (kyori[i][0]-kyori[j][0])**2
        y_distance = (kyori[i][1]-kyori[j][1])**2
        #xとyの距離を計算(sqrt導出)
        Kyorixy = math.sqrt(x_distance + y_distance)
        kyori2.append(Kyorixy)
if len(kyori2) == 1:
    print(kyori2[0])
else:
   goukei = sum(kyori2)*2/N

Submission status: Runtime Error

Solution code:
x,y=map(int,input().split())
ans=1
mod=10**9+7

if (x+y)%3==0 and x<=2*y and y<=2*x:
    a=(x+y)/3
    b=(2*x-y)/3
    a=int(a)
    b=int(b)
    f=[1]
    
    for i in range(1,a+1):
        f.append(f[-1]*i%mod)
    #print(f)
    ans=f[a]//f[b]//f[a-b]  #aCbが答
    if ans>mod:
        ans=ans%mod
else:
    ans=0
print(int(ans))

Submission status: Runtime Error

Solution code:
input = input()
print(input * input)

Submission status: Runtime Error

Solution code:
import math
x,y = map(int,input().split())
mod = 10**9+7

if (2*x-y)%3 != 0 or (-x+2*y)%3 != 0 or y>2*x or x>2*y:
  print(0)
  exit()
  
a = ((2*x-y)//3)%mod
b = ((-x+2*y)//3)%mod


def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

print(cmb(a+b,a)%mod)

Submission status: Runtime Error

Solution code:
#n**p mod m を計算する(デフォルト引数は10**9+7)
def n_ruijyou_p(n,p,m=10**9+7):
    bin_p=format(p,'b')
    ans=1
    nruijyou2i=n
    
    if bin_p[0]=='1':
       ans=ans*nruijyou2i%m

    for i in range(1,len(bin_p)):
        nruijyou2i=(nruijyou2i)**2
        print(nruijyou2i)
        if bin_p[i]=='1':
            ans=ans*nruijyou2i%m
           
    return ans 
  
x,y=map(int,input().split())
print(n_ruijyou_p(x,y))

Submission status: Runtime Error

Solution code:
print(int(inpu())**2)

Submission status: Runtime Error

Solution code:
x,y = map(int,input().split())
a = 1
b = 1
n = (2*y-x)//3
m = (2*x-y)//3

if (x+y)%3 == 0:
  for i in range(n+1,n+m+1):
    a *= i
  for j in range(1,m+1):
    b *= j
  print(a//b)
else:
  print(0)

Submission status: Runtime Error

Solution code:
print(int(r**2))

Submission status: Runtime Error

Solution code:
import math
x,y=map(int,input().split())
if (x+y)%3!=0:
  print(0)
else:
  a=int((2*x-y)/3)
  b=int((2*y-x)/3)
  if a>=0 and b>=0:
    c=int(math.factorial(a+b)/math.factorial(b)/math.factorial(a))
    print(c%(10**9+7))
  else:
    print(0)

Submission status: Runtime Error

Solution code:
x = int(input())
print(x^^2)

Submission status: Runtime Error

Solution code:
import numpy as np

r = input()
c = 1*(np.pi**2)
c2 = r*(np.pi**2)
print(int(c2/c))

Submission status: Runtime Error

Solution code:
import numpy as np
r = raw_input()
c = 1*(np.pi**2)
c2 = r*(np.pi**2)
print(int(c2/c))

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
c=[list(map(int,input().split())) for i in range(n)]
d=list()
s1=0
s2=0
d=[[c[i][1]/c[i][0],c[i][0],c[i][1]] for i in range(n)]
d=sorted(d,key=lambda x:(x[0],x[1]))
for i in range(n):
  s2+=d[i][2]
  s1+=d[i][1]
  if s1>=t-0.5:
    print(s2)
    exit()

Submission status: Runtime Error

Solution code:
import numpy as np
import math
 

xyi = map(int,input().split())
xy = np.array(list(xyi))

x = xy[0]
y = xy[1]
n = 2 * x - y
m = -x + 2 *y

if not n%3 == 0:
    print(0)
else:
    n = int(n/3)
    m = int(m/3)
    cmb = math.factorial(n+m)//math.factorial(n)
    ans = cmb % (10**9 +7)
    print(ans)

Submission status: Runtime Error

Solution code:
n,t=map(int,input().split())
c=[list(map(int,input().split())) for i in range(n)]
d=list()
s1=0
s2=0
d=[[c[i][1]/c[i][0],c[i][0],c[i][1]] for i in range(n)]
d.sort()
for i in range(n):
  s2+=d[i][2]
  s1+=d[i][1]
  if s1>t-0.5:
    print(s2)
    exit()

Submission status: Runtime Error

Solution code:
a = (int)input()
print(a*a)

Submission status: Runtime Error

Solution code:
#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

# aの逆元(mod m)を求める。(aとmは互いに素であることが前提)
def mod_inv(a,m):
    if a%m!=0:
      x = extgcd(a,m)[0]
      return (m+x%m)%m
      

#nCk mod m を計算する(デフォルトの引数は10**9+7)
def c_mod(n,k,m=10**9+7):
  res = 1
  for i in range(1,n+1):
      if (i%m)!=0:
        res = res*i%m
      else:
        res=res/i%m
  for i in range(1,k+1):
      if (i%m)!=0:
        res = res*mod_inv(i,m)%m
      else:
        res=res/i%m
  for i in range(1,n-k+1):
      if (i%m)!=0:
        res = res*mod_inv(i,m)%m
      else:
        res=res/i%m
  return res


x,y=map(int,input().split())
if (2*x-y)%3==0 and (2*y-x)%3==0 and (2*y-x)>0 and (2*x-y)>0 :
  l=int((2*x-y)/3)
  k=int((2*y-x)/3)
  ans=c_mod(l+k,k)

else:
  ans=0
print(ans)

Submission status: Runtime Error

Solution code:
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限x
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )


X, Y = map(int, input().strip().split())

min_num = min(X,Y)
z = min_num//3

tX = z * 3
tY = z * 3
cA = z
cB = z

rx = X - tX
ry = Y - tY
if rx == 0 and ry == 0:
    print(cmb(cA+cB, cA, mod))
    exit(0)
if rx * 2 == ry:
    cA += rx
elif ry * 2 == rx:
    cB += ry
else:
    raise Exception
    print(0)
    exit(0)
print(cmb(cA+cB, cA, mod))

Submission status: Runtime Error

Solution code:
a = map(int,input())
print(a**2)

Submission status: Runtime Error

Solution code:
import numpy as np
import math
X,Y = map(int,input().split())
 
 
c1 = (2*Y-X)
if c1%3!=0:
  print(0)
 
else:
  def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod
  
  c1 = c1//3
  c2 = Y-2*c1
  c3 = c1+c2+1
  mod = 10**9+7
  c4 = min(c1,c2)
  x = 1
  y = 1
  for i in range(1,c4+1):
    x = (x * (c3-i)) % mod
    y = (y * i) % mod
    
  result = (x * pow(y,mod-2,mod)) % mod
 
  print(result)

Submission status: Runtime Error

Solution code:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under



X, Y = (int(i) for i in input().split())
if (X+Y) % 3 == 0 and max(X,Y) - min(X,Y) <= min(X,Y):
    print(cmb(X+Y/3, abs(X-Y)) % (10**9+7))
else:
    print(0)

Submission status: Runtime Error

Solution code:
import sys
mod=10**9+7
x,y=map(int,input().split())

a=(-x+2*y)//3
b=(2*x-y)//3

if a<0 or b<0:
  print(0)
  sys.exit()
  
f=[1]
for i in range(1,a+b+1):
    f.append(f[-1]*i%mod)

if a+2*b==x and 2*a+b==y:
    print(f[a+b]*pow(f[a]*f[b],mod-2,mod)%mod)
else:
    print(0)

Submission status: Runtime Error

Solution code:
import math
X,Y = map(int,input().split())
def comb(n,r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
if (X+Y)%3 != 0:
    print(0)
else:
    n = int((2*Y-X)/3)
    m = int((2*X-Y)/3)
    if n < 0 or m < 0:
        print(0)
    else:
        print((comb(n+m,min([n,m])))%(10**9+7))

Submission status: Runtime Error

Solution code:
mod=10**9+7
x,y=map(int,input().split())

a=(-x+2*y)//3
b=(2*x-y)//3

f=[1]
for i in range(1,a+b+1):
    f.append(f[-1]*i%mod)

if a+2*b==x and 2*a+b==y and (-x+2*y)%3==0 and (2*x-y)%3==0:
    print(f[a+b]*pow(f[a]*f[b],mod-2,mod)%mod)
else:
    print(0)

Submission status: Runtime Error

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

if X > Y:
    ma = X
    mi = Y
else:
    ma = Y
    mi = X

for i in range(mi):
    a = X - 3*i
    b = Y - 3*i
    if a == 2 * b or b == 2 * a:
        import math
        pattern = math.factorial(2*i + ((ma - 3*i)//2)) // (i * (i + ((ma - 3*i)//2)))
        print(pattern % (10**9 + 7))
        break
        
if a != 2 * b and b != 2 * a:
    print(0)

Submission status: Runtime Error

Solution code:
r＝int(input())
print(r**2)

Submission status: Runtime Error

Solution code:
import math
X,Y = map(int,input().split())
def comb(n,r):
    return math.factorial(n) // (math.factorial(n-r) * math.factorial(r))
if (X+Y)%3 != 0:
    print(0)
else:
    n = int((2*Y-X)/3)
    m = int((2*X-Y)/3)
    print((comb(n+m,min([n,m])))%(10**9+7))

Submission status: Runtime Error

Solution code:
import math
import sys
 
 
def Knight():
    def check(d):
        if not ((d[0] % 3 == 0 and d[1] % 3 == 0) or (d[0] % 3 == 1 and d[1] % 3 == 2) or (d[0] % 3 == 2 and d[1] % 3 == 1)):
            print(0)
            sys.exit()
    d = list(map(int, input().split()))
    check(d)
 
    x = d[0]
    y = d[1]
    diff = x - y if x > y else y - x  # aとbの回数の差
    d2 = [x - diff, y - diff * 2] if x < y else [x - diff * 2, y - diff]
    r = d2[0] // 3
 
    def cmb(n, r, mod):
        r = min(r, n-r)
        return g1[n] * g2[r] * g2[n-r] % mod
 
    mod = 10**9+7  # 出力の制限
    N = x if x > y else y
    g1 = [1, 1]  # 元テーブル
    g2 = [1, 1]  # 逆元テーブル
    inverse = [0, 1]  # 逆元テーブル計算用テーブル
 
    for i in range(2, N + 1):
        g1.append((g1[-1] * i) % mod)
        inverse.append((-inverse[mod % i] * (mod//i)) % mod)
        g2.append((g2[-1] * inverse[-1]) % mod)
 
    a = cmb(r*2+diff, r, mod)
 
    print(a)
 
 
Knight()

Submission status: Runtime Error

Solution code:
import numpy as np
def cumprod(arr,MOD):
    L = len(arr); Lsq = int(L**.5+1)
    arr = np.resize(arr,Lsq**2).reshape(Lsq,Lsq)
    for n in range(1,Lsq):
        arr[:,n] *= arr[:,n-1]; arr[:,n] %= MOD
    for n in range(1,Lsq):
        arr[n] *= arr[n-1,-1]; arr[n] %= MOD
    return arr.ravel()[:L]

def make_fact(U,MOD):
    x = np.arange(U,dtype=np.int64); x[0] = 1
    fact = cumprod(x,MOD)
    x = np.arange(U,0,-1,dtype=np.int64); x[0] = pow(int(fact[-1]),MOD-2,MOD)
    fact_inv = cumprod(x,MOD)[::-1]
    return fact,fact_inv

U = 10**6
fact, invfact = make_fact(U,MOD)

MOD = 10**9 + 7
X, Y = [int(x) for x in input().split()]
if (X+Y) % 3 != 0:
    print(0)
    exit()
r = (X+Y) // 3
k = X - r
if (k < 0 or Y - r < 0):
    print(0)
else:
    print(fact[r] * invfact[r-k] % MOD * invfact[k] % MOD)

Submission status: Runtime Error

Solution code:
#Beginner COnetst 145 /2019/11/16
#Probrem A
#import math
from operator import mul
from functools import reduce

DEBUG = 0

def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom

def calc(x,y):
    if (x*2-y)%3 != 0 or (y*2-x)%3 != 0: return 0
    m = (x*2-y)//3
    n = (y*2-x)//3
    if m <= 0 or n <= 0:return 0
    return combinations_count(m+n,m)

X,Y = list(map(int, input().split()))

if DEBUG:print(X,Y)

print(calc(X,Y)%(10**9+7))

Submission status: Runtime Error

Solution code:
t = input().rstrip().split(" ")
x = int(t[0])
y = int(t[1])
temp = {}
def get_num(x, y):
    res = 0
    if (x == 0) and (y == 0):
        res = 1
    elif (x <= 0) or (y == 0):
        res = 0
    elif (x, y) in temp:
        res = temp[(x, y)]
    else:
        res += get_num(x-1, y-2)
        res += get_num(x-2, y-1)
        res %= (1e9 + 7)
        temp[(x, y)] = res
    return res

print(int(get_num(x, y)))

Submission status: Runtime Error

Solution code:
print(int(inpuut())*4)

Submission status: Runtime Error

Solution code:
x, y = input().split()
x = int(x)
y = int(y)
xy_sum = x + y
point_num = 0
kimari = 10 ** 9 + 7
if (xy_sum % 3 == 0):
    point_num += ((xy_sum - 1) / 3) ** 2
    point_num += (xy_sum - 1) // 6
    count = 2 ** point_num
    print(count % kimari)
else:
    print(0)

Submission status: Runtime Error

Solution code:
import sys
x, y = map(int, input().split())


def power_func(a, b, p):
    if b == 0:
        return 1
    if b % 2 == 0:
        d = power_func(a, b//2, p)
        return d*d % p
    if b % 2 == 1:
        return (a*power_func(a, b-1, p)) % p


def comb(n, k, p):
    from math import factorial
    if n < 0 or k < 0 or n < k:
        return 0
    if n == 0 or k == 0:
        return 1
    a = factorial(n) % p
    b = factorial(k) % p
    c = factorial(n-k) % p
    return (a*power_func(b, p-2, p)*power_func(c, p-2, p)) % p


w = (x + y) / 3
b = (- x + 2*y) // 3

if w.is_integer():
    w = int(w)
else:
    print(0)
    sys.exit()

a = min(b, w-b)
ans = comb(w, a, 10**9+7)
print(ans)

Submission status: Runtime Error

Solution code:
import numpy as np
import math
n=int(input())
li=[]
a=[]
b=[]
s=0
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break;
for x in li:
  a.append(x[0])
  b.append(x[1])

for i in range(0,n):
  for j in range(i,n):
  	s+=np.sqrt(((a[j]-a[i])**2)+((b[j]-b[i])**2))

p=math.factorial(n)
print(s)

Submission status: Runtime Error

Solution code:
N = int(input())
data = []
sum = 0
x = 0
y = 1
ss=[0,0,2,4,18,96,600,4320,35280]
for i in range(N):
    data.append( list(map(int,input().split())))
for i in range(N -1):
    for j in range(N - 1):
        if(j+1+i==N):
            break
        sum+=((data[i][x]-data[j+1+i][x])**2+(data[i][y]-data[j+1+i][y])**2)**0.5

print(sum*ss[N]/N)

Submission status: Runtime Error

Solution code:
N, T = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
dp = [[0] * (T+1) for _ in range(N+1)]
AB.sort(key = lambda x:x[0], reverse=True)
AB[0][0] = 0
for i in range(1,N+1):
    for j in range(1,T+1):
        if j < AB[i-1][0]:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i-1][j-AB[i-1][0]] + AB[i-1][1], dp[i-1][j])
print(dp[N][T])

Submission status: Runtime Error

Solution code:
N = int(input())
S = [input().split() for i in range(N)]
T = S[0:N / 2 - 1]

if N >= 1 and N <=100:
	def S.islower():
	if True and T + T in s:
    	print('Yes')
    else:
  		print('No')

Submission status: Runtime Error

Solution code:
def examE():
    N, T = LI()
    A, B = [0] * N, [0] * N
    for i in range(N):
        A[i], B[i] = LI()
    dp = [[[0,0] for _ in range(T+ 1)] for _ in range(N + 1)]
    for i in range(N):
        for j in range(A[i],T+1):
            dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j - A[i]][0] + B[i])
            dp[i + 1][j][1] = max(dp[i + 1][j][1], dp[i][j - A[i]][1] + B[i])
        for j in range(1,T+1):
            dp[i+1][j][1] = max(dp[i+1][j][1], dp[i][j-1][0] + B[i])
            dp[i + 1][j][0] = max(dp[i + 1][j][0], dp[i][j][0])
            dp[i + 1][j][1] = max(dp[i + 1][j][1], dp[i][j][1])
#    print(dp[N][T])
    ans = max(dp[N][T])
    print(ans)

import sys,copy,bisect,itertools
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examE()

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

ef main():
	r = inputInt()
 
	a = r*r
	print(a)


if __name__ == "__main__":
	main()

Submission status: Runtime Error

Solution code:
r = int(input().split())

print(int(r*r))

Submission status: Runtime Error

Solution code:
r = int(input().split())

print(r**2)

Submission status: Runtime Error

Solution code:
r = int(input)

print(int(r**2))

Submission status: Runtime Error

Solution code:
n = input()
print(n*n)

Submission status: Runtime Error

Solution code:
r=list(map(int, input().split()))
print(r*r)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()
sol = 0


for i in range(n // 2):
    
    if s[i - 1] == s[i - 1 + (n // 2)]:
        sol = sol + 1
 
if sol == n // 2:
    if n != 1 and n % 2 == 0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Runtime Error

Solution code:
r=int(input())
print(int(r**2)

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()

sol = 0

if n % 2 == 0:
    for i in range(n // 2):
    
        if s[i - 1] == s[i - 1 + (n // 2)]:
            sol = sol + 1
 
    if sol == n // 2:
        print("Yes")
 
    else:
        print("No")

else:
    print("No")

Submission status: Runtime Error

Solution code:
listnum = int(input())
string = input()

halfnum = listnum // 2
halfstr = string[0:halfnum]
if string == halfstr + halfstr:
	print('Yes')
else:
	print('No')

Submission status: Runtime Error

Solution code:
n = int(input())
s = input()

sol = 0
 
for i in range(n // 2):
    
    if s[i - 1] == s[i - 1 + (n // 2)]:
        sol = sol + 1
 
if sol == n // 2:
    if n > 1:
        print("Yes")
    else:
        print("No")
 
else:
    print("No")