Problem:


Score : 100 points

Problem Statement

Given an integer a as input, print the value a + a^2 + a^3.

Constraints

1 \leq a \leq 10

a is an integer.

Input

Input is given from Standard Input in the following format:

a

Output

Print the value a + a^2 + a^3 as an integer.

Sample Input 1

2

Sample Output 1

14

When a = 2, we have a + a^2 + a^3 = 2 + 2^2 + 2^3 = 2 + 4 + 8 = 14.

Print the answer as an input. Outputs such as 14.0 will be judged as incorrect.

Sample Input 2

10

Sample Output 2

1110



Sample input:
2


Sample output:
14

Submission status: Runtime Error

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


def main():
    n, m, k = map(int, input().split())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    a = A[0]
    A2 = [a]
    b = B[0]
    B2 = [b]
    for i in range(1, n):
        a += A[i]
        A2.append(a)

    for i in range(1, m):
        b += B[i]
        B2.append(b)
    max = -2
    for ia, aa in enumerate(A2):
        for ib, bb in enumerate(B2):
            if aa + bb > k:
                break
            if ia + ib > max:

                max = ia + ib
    print(max + 2)


def answer():
    N, M, K = map(int, input().split())


    A = list(map(int, input().split()))
    B = list(map(int, input().split()))

    a, b = [0], [0]
    for i in range(N):
        a.append(a[i] + A[i])
        for i in range(M):
            b.append(b[i] + B[i])

        ans, j = 0, M
        for i in range(N + 1):
        if a[i] > K:
        break
        while b[j] > K - a[i]:
        j -= 1
        ans = max(ans, i + j)
        print(ans)
if __name__ == '__main__':
    answer()

Submission status: Runtime Error

Solution code:
n=int(input())
print(a*(1+a+a*a))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ubkookoookyfyut

Submission status: Runtime Error

Solution code:
unko

Submission status: Runtime Error

Solution code:
afgdgrh

Submission status: Runtime Error

Solution code:

def function(a):
  return a+a**2+a***3

if __name__ == '__main__':
  a = int(input())
  function(a)

Submission status: Runtime Error

Solution code:
a = int(input())

ans = a+a*a+a*a*a

return ans

Submission status: Runtime Error

Solution code:
a = int(input())

ans = a+a*2+a*3

return ans

Submission status: Runtime Error

Solution code:
a = int(input())

ans = a+a*2+a*3

print ans

Submission status: Runtime Error

Solution code:
a = int(input())

int ans = a+a*2+a*3

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 #出力の制限
N = 5*10**5 #Nの最大値
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 )

N, M = map(int, input().split())
ans = 0
for i in range(N+1):
    ans += cmb(N,i,mod)*((-1)**i)*g1[M]*g2[M-i]*((g1[M-i]*g2[M-N])**2)
    ans %= mod
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 #出力の制限
N = 5*10**5
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 )

N, M = map(int, input().split())
ans = 0
for i in range(N+1):
    ans += cmb(N,i,mod)*((-1)**i)*g1[M]*g2[M-i]*((g1[M-i]*g2[M-N])**2)
    ans %= mod
print(ans)

Submission status: Runtime Error

Solution code:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0], [0]
for i in range(N):
a.append(a[i] + A[i])
for i in range(M):
b.append(b[i] + B[i])

ans, j = 0, M
for i in range(N + 1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
      j -= 1
ans = max(ans, i + j)
print(ans)

Submission status: Runtime Error

Solution code:
S = input()
T = input()
count = 0
for i in range(len(S)):
    if S[i] != T[i]:
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
    S = input()
    T = input()
    count = 0
    for i in range(len(S)):
        if S[i] != T[i]:
            count += 1

    print(count)

Submission status: Runtime Error

Solution code:
a = input()
print('a + a**2 + a**3)

Submission status: Runtime Error

Solution code:
n = int(input())
print(a + '+' + a**2  + '+' + a**3)

Submission status: Runtime Error

Solution code:
s, t = input(), input()

x = list(filter(lambda i:s[i] != t[i], range(len(s)) ))

print(len(x))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
print(a * (a ** 3 - 1) / (a - 1))

Submission status: Runtime Error

Solution code:
a=int(input())
print(a+a＊＊2+a＊＊3)

Submission status: Runtime Error

Solution code:
a = input()
a + a ** 2 + a ** 3 = A
print(A)

Submission status: Runtime Error

Solution code:
a = input()
a + a **2 + a ** 3 = A
print(A)

Submission status: Runtime Error

Solution code:
a = input()
	print(a + a ** 2 + a ** 3)

Submission status: Runtime Error

Solution code:
a = input()
a + a * 2 + a * 3 = Z
 print(Z)

Submission status: Runtime Error

Solution code:
a = input()
 print(a + a * 2 + a * 3)

Submission status: Runtime Error

Solution code:
a = input()
 print(a + a * 2 + a * 3 = Z)

Submission status: Runtime Error

Solution code:
input(a)
 print(a + a * 2 + a * 3)

Submission status: Runtime Error

Solution code:
input(a)
 print("a + a * 2 + a * 3")

Submission status: Runtime Error

Solution code:
input(a)
 print(a + a * 2 + a * 3 = Z)

Submission status: Runtime Error

Solution code:
input(a)
 
a + a * 2 + a * 3 = Z
	print("Z")

Submission status: Runtime Error

Solution code:
input(a)
 
a * 2 + a * 3 + a * 4 = Z
	print("Z")

Submission status: Runtime Error

Solution code:
input(a)
 
a ** 2 + a ** 3 + a ** 4 = Z
	print("Z")

Submission status: Runtime Error

Solution code:
input(a)

a**2 + a**3 + a**4 = Z
print("Z")

Submission status: Runtime Error

Solution code:
a=input()

x=a+(a*a)+(a*a*a)

print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = input()
A = a + a*a + a*a*a
print(A)

Submission status: Runtime Error

Solution code:
input(a)
A = a + a*a + a*a*a
print(A)

Submission status: Runtime Error

Solution code:
imput(a)
A = a + a^2 + a^3
print(A)

Submission status: Runtime Error

Solution code:
d = int(input())
print(int(d+d**2+d***3))

Submission status: Runtime Error

Solution code:
a = int(input())
print(int(a+a^2+a3))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a + a ** 2 + a ** 10

Submission status: Runtime Error

Solution code:
a = int(intput())
ans = a*(1+a*(1+a))
print(ans)

Submission status: Runtime Error

Solution code:
a = input()
ans = a + a ^ 2 + a ^ 3
print ans

Submission status: Runtime Error

Solution code:
import re
import sys
S = input()
T = input()
w = 0
if not re.match(r'^[a-z]+$', S) or not re.match(r'^[a-z]+$', T) or len(S) != len(T) or (10 ** 5 * 2) < len(S):
  sys.exit()
if S != T:
  i = 0
  for l in S:
    if l != T[i]:
      w = w + 1
    i = i + 1
print(w)

Submission status: Runtime Error

Solution code:
firstString = input()
secondString = input()
diff = 0
for i in range(len(firstString)):
    if firstString[i] != secondString[i]:
        diff += 1
print(diff)

Submission status: Runtime Error

Solution code:
input = int(raw_input())
print (input + input ** 2 + input ** 3)

Submission status: Runtime Error

Solution code:
s = input()
t = input()
count = 0
for i in range(len(s)):
    if(s[i] != t[i]):
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
s = list(map(str,input().split()))
t = list(map(str,input().split()))
count = 0
for i in range(len(s)):
    if(s[i] != t[i]):
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
from collections import defaultdict
mem = defaultdict(lambda : None)
mem[(0,0,0)] = 0
def dp(a,b,s):
  if mem[(a,b,s)] is not None:
    return mem[(a,b,s)]
  x = a&1
  y = b&1
  xor = s&1
  res = float("inf")
  if x^y != xor:
    mem[(a,b,s)] = res
    return res
  else:
    res = 2*dp(a>>1,b>>1,s>>1)
    if a > 1:
      pants = 2*dp((a-1)>>1,(b+1)>>1,s>>1)+1
      if pants < res:
        res = pants
  mem[(a,b,s)] = res
  return res

n = int(input())
a = list(map(int, input().split()))
s = 0
for i in a[2:]:
  s ^= i
b = a[1]
a = a[0]
ans = dp(a,b,s)
if ans == float("inf"):
  ans = -1
print(ans)

Submission status: Runtime Error

Solution code:
a=int(intput())
print(a+a^2+a^3)

Submission status: Runtime Error

Solution code:
a=int(intput())
a+a^2+a^3

Submission status: Runtime Error

Solution code:
a=input()

print(a+a*a+a*a*a)

Submission status: Runtime Error

Solution code:
num = input()
 
answer = num + num * num + num * num * num

print(answer)

Submission status: Runtime Error

Solution code:
num = input()

answer = num + num * num + num * num * num

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a*+a**2+a***3

Submission status: Runtime Error

Solution code:
from collections import defaultdict as dd
from collections import deque
import bisect
import heapq

def ri():
    return int(input())

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


def solve():
    a = ri()
    print (a + a*a + a*a*a)





mode = 's'

if mode == 's':
    t = ri()
    for i in range(t):
        solve()
else:
    solve()

Submission status: Runtime Error

Solution code:
N,M,K=map(int,input().split())
A=list(map(int,input().split()))
A.insert(0,0)
B=list(map(int,input().split()))
B.insert(0,0)
best=0
for a in range(len(A)):
    atime=0
    btime=0
    for i in range(a+1):
        atime=atime+A[i]
        if atime>K:
          break
    else:
        for b in range(len(B)):
            btime=btime+B[b]
            if atime+btime>K:
                book=a+b-1
                if book>best:
                    best=book
                break
        else:
            book=a+b
            if book>best:
                best=book
print(best)

Submission status: Runtime Error

Solution code:
s = str(input())
t = str(input())
count = 0

for i in range(len(s)):
    if s[i] != t[i]:
        count +=1

print(count)

Submission status: Runtime Error

Solution code:
s = str(input())
t = str(input())
count = 0

for i in range(len(s)):
    if s[i] != t[i]:
        count +=1

print(count)

Submission status: Runtime Error

Solution code:
S = list(input ())
T = list(input ())
a = len(S)
change_time = 0
 
for i in range(a):
  if S[i] ==T[i]:
  	continue
  
  else:
  	S[i] =T[i]
  	change_time += 1
  
  
print(change_time)

Submission status: Runtime Error

Solution code:
S = list(input ())
T = list(input ())
a = len(S)
change_time = 0
 
for i in a:
  if S[i] ==T[i]:
  	continue
  
  else:
  	S[i] =T[i]
  	change_time += 1
  
  
print(change_time)

Submission status: Runtime Error

Solution code:
s = input()
t = input()
n = len(s)
ans = 0
for i in range(n):
    if s[i] != t[i]:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
t = input()
n = len(s)
ans = 0
for i in range(n):
    if s[i] != t[i]:
        s[i] = t[i]
        x += 1
print(ans)

Submission status: Runtime Error

Solution code:
s = input()
t = input()
n = len(s)
s.split()
t.split()
ans = 0
for i in range(n):
    if s[i] != t[i]:
        s[i] = t[i]
        x += 1
    else:
        pass
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def main():
    n,m,k = input().split()
    n=int(n)
    m=int(m)
    k=int(k)

    n_list = list(map(int,input().split()))
    m_list = list(map(int,input().split()))
    a, b =[0],[0]
    for i in range(n):
        a.append(a[i]+n_list[i])
    for j in range(m):
        b.append(b[j]+m_list[j])
    
    j=m
    ans = 0
    for i in range(n+1):
        if a[i]>k:
            break
        while b[j]+a[i]>k:
            j -= 1
        ans = max(ans,i+j)
    print(ans)
main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a=int(input()) #aを整数aの変数として扱う
print(a+a*a+a**3)　#a+a*a+a**3の値を表示する

Submission status: Runtime Error

Solution code:
def calc(int: a) -> int:
    return a+a**2+a**3

if __name__ == "__main__":
    a = int(input())
    print(calc(a))

Submission status: Runtime Error

Solution code:
print (a + a*a + a*a*a)

Submission status: Runtime Error

Solution code:
YB2GzdOwUf0qM35F+DsIMp8BIJK/gvp3NZ+LAmCf2VA=

Submission status: Runtime Error

Solution code:
n=int(input())
p=a+a**2+a**3
print(p)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
b = a + a**2 + a**3
print(b)

Submission status: Runtime Error

Solution code:
a, b = 0, 0
  b = a + a**2 + a**3
  print(b)

Submission status: Runtime Error

Solution code:
a, b = 0, 0
for a in range (1, 11):
  b = a + a**2 + a**3
  print b

Submission status: Runtime Error

Solution code:
a, b = 0, 0
for a in range (1, 11):
  b = a + a**2 + a**3
  print b

Submission status: Runtime Error

Solution code:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]*(N+1)
b = [0]*(M+1)
X = 0
Y = 0
cnt = 0
for n in range(N):
    a[n+1] = a[n] + A[n]
for n in range(M):
    b[n+1] = b[n] + B[n]
for n in range(1, N+1):
    if a[n] <= K:
        X = n
for m in range(1, M+1):
    if b[m] <= K:
        Y = m 
if a[X] < b[Y]:
    K = K - a[X]
    cnt += X
    if K - b[Y] == 0:
        cnt += Y
    else:
        for y in range(1, Y+1):
            if b[y] < K:
                cnt += 1
else:
    K = K - b[Y]
    cnt += Y
    if K - a[X] == 0:
        cnt += X
    else:
        for x in range(1, X+1):
            if a[x] < K:
                cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
a=int(inupt())
print(a+a*a+a*a*a)

Submission status: Runtime Error

Solution code:
def main():
  a = int(input())
  answer = a + a**2 + a**3
  print(answer)

if __name__ = '__main__':
  main()

Submission status: Runtime Error

Solution code:
a = int(inut())

print(a**3+a**2+a)

Submission status: Runtime Error

Solution code:
a = input()
print(a + a**2 +a**3)

Submission status: Runtime Error

Solution code:
a = int(input())
  if 1<=a<=10: 
    b = a + a**2 + a**3
    print(b)

Submission status: Runtime Error

Solution code:
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
sum_list = []
for i in range(N):
  if K < sum(A[:i+1]):
    break
  for j in range(M):
    sum_ = sum(A[:i+1]) + sum(B[:j+1])
    if sum_ <= K:
      sum_list.append(len(A[:i+1]) + len(B[:j+1]))
    elif K < sum_:
      break
if 1 <= len(sum_list):
  print(max(sum_list))
elif 0 == len(sum_list):
  print(0)

Submission status: Runtime Error

Solution code:
from numba import njit

@njit("i8(i8)")
def solve(n):
    s = [1] * (n+1)
    ans = 1
    for i in range(2,n+1):
        for j in range(i,n+1,i):
            s[j] += 1
        ans += (i * s[i])
	return ans
n = int(input()) 
print(solve(n))

Submission status: Runtime Error

Solution code:
a = int(input())
print(a+pow(a,2)+pow(a,3)

Submission status: Runtime Error

Solution code:
s=input()

int a = s*s*s+s*s+s

 return

Submission status: Runtime Error

Solution code:
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
a.insert(0,0)
b.insert(0,0)
j=1
while j<=m and b[j]+b[j-1]<=k:
  b[j]+=b[j-1]
  j+=1
  

j-=1
books=j
i=1
while i<n+1:
  while j>0 and a[i]+b[j]>k:
    j-=1
  if(j>=0) and a[i]+b[j]<=k:
    books=max(books,j+i)
    a[i]+=a[i-1]
    i+=1
  else:
    break
print(books)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(a + a ** 2 + a ** 3)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
print(a^3 + a^2 + a)

Submission status: Runtime Error

Solution code:
N = int(input())
print(N + N*N + N **300

Submission status: Runtime Error

Solution code:
def main():
    n, m, k = map(int, input().split())
    a = [int(x) for x in input().split()]
    b = [int(x) for x in input().split()]

    a_sum = [0 for x in range(n)]
    b_sum = [0 for x in range(m)]

    a_sum[0] = a[0]
    b_sum[0] = b[0]

    max_counter = 0

    for i in range(1, n):
        a_sum[i] = a[i] + a_sum[i - 1]

    for i in range(1, m):
        b_sum[i] = b[i] + b_sum[i - 1]

    for i in range(n):
        for j in range(m):
            if k >= a_sum[i] + b_sum[j] and max_counter < i + j + 2:
                max_counter = i + j + 2
        
    print(max_counter)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
n = int(input())
s = 0
for i in range(1,4):
  s += a**i

Submission status: Runtime Error

Solution code:
import sys

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

print(a+a*a+a*a*a

Submission status: Runtime Error

Solution code:
a = int(input())

print(round(a*a*a+a*a+a)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
in1 = input().split(' ')
N=int(in1[0])
M=int(in1[1])
K=int(in1[2])

inA = input().split(' ')
inB = input().split(' ')

T = 0
Ac=0
Bc=0

while T < K:
  
  if Ac>=N and Bc>=M:
    break
  elif Ac>=N:
    Bn=int(inB[Bc])
    T+=Bn
    Bc+=1
  elif Bc>=M:
    An=int(inA[Ac])
    T+=An
    Ac+=1
  else:
    An=int(inA[Ac])
    Bn=int(inB[Bc])
    if An>Bn:
      T+=An
      Ac+=1
    else:
      T+=Bn
      Bc+=1
  
  

print(Ac+Bc)

Submission status: Runtime Error

Solution code:
n,m,k=map(int,input().split())
a=list(map(int,input().split()))
b=list(map(int,input().split()))

import numpy as np
import bisect

ra=[0]+list(np.cumsum(a))
rb=[0]+list(np.cumsum(b))

ans=0
for i in range(n+1):    
    capa = k - ra[i]
    if ra[i]<0:
        break
    j=bisect.bisect_right(rb,capa)


    ans=max(ans,i-1+j)
            
print(ans)

Submission status: Runtime Error

Solution code:
a = input()

print(a + a*a + a^3)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
total = a + a**2 + a**3
ptint(total)

Submission status: Runtime Error

Solution code:
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int,input().split()))
a,b = [0],[0]
for i in range(N):
    a.append(a[i] + A[i])
    
for i in range(M):
    b.append(b[i] + B[i])
totaltime = 0
count,j = 0, M
 
for i in range(N+1):
    if a[i] > K:
        break
    while a[i] + b[j] > K:
        j -= 1
    count = max(count,i + j)
 
print(count)

Submission status: Runtime Error

Solution code:
n=input()
print(n+n**2+n**3)

Submission status: Runtime Error

Solution code:
A = int(input())

print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
n,m,k = map(int,input().split())
A = [int(p) for p in input().split()]
B = [int(p) for p in input().split()]
a,b = [0],[0]

a_apnd = a.append
b_apnd = b.append
for i in range(n):
  a_apnd(a[i]+A[i])
for i in range(m):
  b_apnd(b[i]+B[i])

count = 0
t = m
for i in range(n+1):
  if k<a[i]:
    break
  while b[t] > k-a[i]:
    t -= 1
  count = max(count,i+t)

print(count)

Submission status: Runtime Error

Solution code:
from sys import stdin
a = stdin.readline().rstrip()
print(a+a**2+a**3)

Submission status: Runtime Error

Solution code:
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
A.append(10**9+1)
B.append(10**9+1)

Ac = 0
Bc = 0
Time = 0
for _ in range(N+M):
    if A[Ac] > B[Bc]:
        Time += B[Bc]
        Bc += 1
        if Time > K:
            Bc -= 1
            Time -= B[Bc]
            break
    else:
        Time += A[Ac]
        Ac += 1
        if Time > K:
            Ac -= 1
            Time -= A[Ac]
            break
            
print(Ac+Bc)

Submission status: Runtime Error

Solution code:
from sys import exit
import copy
# import numpy as np
from collections import deque

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

cnt = 0


a.insert(0, 0)
b.insert(0, 0)


for i in range(1, n+1):
    a_sum[i] += a_sum[i-1]

for i in range(1, m+1):
    b_sum[i] += b_sum[i-1]


for i in range(n+1):
    for j in range(m+1):
        if a_sum[i] + b_sum[j] <= k:
            pass
        else:
            if a_sum[i] + b_sum[j-1] <= k:
                cnt = max(cnt, i + j - 1)
            break
    else:
        if a_sum[i] + b_sum[j] <= k:
            cnt = max(cnt, i + j)
print(cnt)

Submission status: Runtime Error

Solution code:
?ddd1+**+p

Submission status: Runtime Error

Solution code:
N,M,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ans = 0
min = 0
i = 0
j = 0
while min <= K:
	if (i < N) or (j < M):
		if (i < N) and (j < M):
			if A[i]<=B[j]:
				min = min+A[i]
				i = i+1
				ans = ans+1
			else:
				min = min+B[j]
				j = j+1
				ans = ans+1
		elif (i == N):
				min = min+B[j]
				j = j+1
				ans = ans+1
		else:
				min = min+A[i]
				i = i+1
				ans = ans+1
	else:
		ans = ans+1
		break
ans = ans-1
print(ans)

Submission status: Runtime Error

Solution code:
a=int(input())
print(round((a*(a-(-1+math.sqrt(3)*(1j))/2)*(a-(-1-math.sqrt(3)*(1j))/2)).real))

Submission status: Runtime Error

Solution code:
str1 = list(input())
str2 = list(input())
count = 0
for i in range(len(str1)):
  if str1[i] != str2[i]:
    count +=1
print(count)

Submission status: Runtime Error

Solution code:
N,M,K = map(int, input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

a,b=[0],[0]
for i in range(N):
    a.append(a[i]+A[i])
for i in range(M):
    b.append(b[i]+B[i])

ans,j =0,M
for i in range(N+1):
    if a[i]>K:
        break
    while b[j]>K-a[i]:
        j-=i
    ans =max(ans,i+j)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

print(a + a*a + a*a*a)

Submission status: Runtime Error

Solution code:
a,b,c = (int(i) for i in input().split())
N = list(map(int, input().split())) 
M = list(map(int, input().split())) 
n = 0
m = 0
e = 0
for i in range(a+b):
  if N[n] < M[m] and n < a:
    c -= N[n]
    e += 1
    print(c)
    n += 1
  elif N[n] > M[m] and m < a:
    c -= M[m]
    e += 1
    m += 1
    print(c)

  if c < 0:
    e -= 1
    break

print(e)

Submission status: Runtime Error

Solution code:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
now = b[0]
ans = 0
for i in range(len(a)+len(b)):
    if now >= k:
        break
    else:
        if len(a) == 0:
            ans += 1
            now += b[0]
            b.remove(b[0])
        elif len(b) == 0:
            ans += 1
            now += a[0]
            a.remove(a[0])
        else:
            if a[0] < now:
                ans += 1
                now += a[0]
                a.remove(a[0])
            else:
                now = b[1]
                ans += 1
                now += b[0]
                b.remove(b[0])
print(ans)

Submission status: Runtime Error

Solution code:
a = input('>> ')
print(int(a+a**2+a**3))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n,m,k = map(int, input().split())
ab = list(map(int, input().split())) + list(map(int, input().split()))
O = 0
ab.sort()
for i in range(len(ab)):
    k -= ab[i]
    if k < 0:
        break
    O +=1
print(O)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import copy
from sys import exit
from math import ceil
from collections import defaultdict as dd
n = int(input())
yakusuu_dic = dd(lambda: dd(int))
f = [0] * (n+1)
f[1] = 1
f[2] = 2

if n == 1:
    print(1)
    exit()
if n == 2:
    print(5)
    exit()
sosus = [2]

counter = 0
yakusuu_dic[2] = {2: 1}
for num in range(3, n+1):
    #print(num)
    for divider in sosus:
        if num % divider == 0:
            yakusuu_dic[num] = copy.deepcopy(yakusuu_dic[num // divider])
            yakusuu_dic[num][divider] += 1
            if divider in yakusuu_dic[num // divider]:
                f[num] = f[num // divider] // (yakusuu_dic[num // divider][divider] + 1) * (yakusuu_dic[num // divider][divider] + 2)
            else:
                f[num] = f[num // divider] * 2
            break
    else:
        yakusuu_dic[num][num] = 1
        f[num] = 2
        sosus.append(num)

counter = 0
for i in range(1, n+1):
    counter += i * f[i]
print(counter)

Submission status: Runtime Error

Solution code:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
if sum(a)+sum(b)<=k:
    print(n+m)
    exit()
num = 0
cnt = -1
for i in range(n+m):
    if num>k:
        break
    elif a == []:
        num += b[0]
        cnt +=1
        del b[0]
    elif b == []:
        num += a[0]
        cnt += 1
        del a[0]
    elif a[0] <= b[0]:
        num += a[0]
        cnt += 1
        del a[0]
    else:
        num += b[0]
        cnt += 1
        del b[0]
print(cnt)

Submission status: Runtime Error

Solution code:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

count = 0

for x,y in zip(a,b):
  count += min(a[x],b[y])
  if count > k:
    break
    
print(k // count)

Submission status: Runtime Error

Solution code:
from collections import deque
from decimal import *
n,m,k = [Decimal(int(e)) for e in input().split()]
As = deque([Decimal(int(e)) for e in input().split()])
Bs = deque([Decimal(int(e)) for e in input().split()])
result = 0
while True:
    if (not As) and (not Bs):
        break
        
    if (not As) and (Bs[0]>k):
        break
    if (not As) and (Bs[0]<=k):
        k = k-Bs.popleft()
        result = result + 1
        continue
        
    if (not Bs) and (As[0]>k):
        break
    if (not Bs) and (As[0]<=k):
        k = k-As.popleft()
        result = result + 1
        continue
    
    
    if As[0]+As[1] <= Bs[0]+Bs[1]:
        min_reduce = As.popleft()
    else:
        min_reduce = Bs.popleft()

    if min_reduce > k:
        break
    else:
        k = k-min_reduce
        result = result + 1
print(result)

Submission status: Runtime Error

Solution code:


def main():
    n, m, k = map(int, input().split())
    aa = list(map(int, input().split()))
    bb = list(map(int, input().split()))
    ans = []
    time_sum = 0
    for i in range(n):
        for j in range(1, m):
            time_sum = sum(aa[:i]) + sum(bb[:j])
            if time_sum <= k:
                ans.append(i+j)

    if(len(ans) == 1):
        return ans[0]
    else:
        return max(ans)


if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Runtime Error

Solution code:
n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

count = 0

for i in zip(a,b):
  count += min(a[i],b[i])
  if count > k:
    break
    
print(k // count)

Submission status: Runtime Error

Solution code:
import numpy as np
S = input()
T = input()
s = []
t = []
i = 0
for i in range(len(S)):
    s.append(ord(S[i]))
    i += 1
i = 0
for i in range(len(T)):
    t.append(ord(T[i]))
    i += 1
    
s = np.array(s)
t = np.array(t)
print(len(S) - np.count_nonzero(s == t))

Submission status: Runtime Error

Solution code:
N,M,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
for i in range(N):
  del A[1]
  del B[1]

Submission status: Runtime Error

Solution code:
def FindSum(a, n)
   sum = 0
   for i in range(1, n + 1):
     sum += (i / mathpow(a, i));
   return sum
   a = 3, n = 3
print(FindSum(a, n));

Submission status: Runtime Error

Solution code:
n, m ,k = map(int,input().split())
a_list = [int(a) for a in input().split()]
b_list = [int(b) for b in input().split()]
time = 0
a_num = 0
b_num = 0
count = 0

# 次回が小さい方を選択する
while True:
    
    if (len(a_list) < a_num + 1) and (len(b_list) < b_num + 1): 
        break

    elif  (len(a_list) < a_num + 1) and(len(b_list) >= b_num + 1):
        time += b_list[b_num]      
        b_num += 1
     
    elif (len(a_list) >= a_num + 1) and (len(b_list) < b_num + 1):
        time += a_list[a_num]      
        a_num += 1
        
    else:
        if sum(a_list[a_num:]) < sum(b_list[b_num:]):
            time += a_list[a_num]
            a_num += 1
        else:
            time += b_list[b_num]      
            b_num += 1
    
    if time <= k:
        count += 1
    else:
        break

print(count)

Submission status: Runtime Error

Solution code:
s = [input() for i in range(2)]
S = s[0]
T = s[1]
print(S)
print(T)


def count_diff2(s, t):
    cnt = 0
    for c1,c2 in zip(s, t):
        if c1 != c2:
            cnt += 1
    return cnt

print(count_diff2(S, T))

Submission status: Runtime Error

Solution code:
a=int(input())
b=a**2
c=a***3
print(a+b+c)

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
A.append(99999)
B.append(99999)
Sum = 0
i = 0
j = 0
while True:
  if A[i] <= B[j] and Sum + A[i] <= K:
    Sum += A[i]
    i += 1
  elif A[i] > B[j] and Sum + B[j] <= K:
    Sum += B[j]
    j += 1
  else:
    break
print(i + j)