TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
n,k=map(int,input().split())
A=list(map(int,input().split()))
high=max(A)
low=0
while high-low>1:
    cnt=0
    now=(low+high)//2
    for a in A:
        cnt+=max((a-1)//now,0)
        if cnt>k:
            break
    if cnt>k:
        low=now
    else:
        high=now
    print(cnt,low,high)
print(high)

n,k=map(int,input().split())
A=list(map(int,input().split()))
high=max(A)
low=0
while high-low>1:
    cnt=0
    now=(low+high)//2
    for a in A:
        cnt+=max((a-1)//now,0)
        if cnt>k:
            break
    if cnt>k:
        low=now
    else:
        high=now
    #print(cnt,low,high)
print(high)

Verdicts: Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
n,k = map(int,input().split())
a = list(map(int,input().split()))
l = 0
r = 10 ** 9

while r-l > 1 :
    m = (l+r)//2 
    b = list(map(lambda x: -(-x//m) - 1 ,a))
    ans = sum(b)
    if ans <= k :
        r = m
    else :
        l = m
    print(l,r)

print(r)

         



n,k = map(int,input().split())
a = list(map(int,input().split()))
l = 0
r = 10 ** 9

while r-l > 1 :
    m = (l+r)//2 
    b = list(map(lambda x: -(-x//m) - 1 ,a))
    ans = sum(b)
    if ans <= k :
        r = m
    else :
        l = m

print(r)

         



Verdicts: Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):

import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache
import copy
# @lru_cache(maxsize=None)

input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7

# region input function


def inp():
    
    return int(input())


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


def str_inp():
    
    return list(input()[:-1])




n, k = inpl()
a = inpl()

l = 1
r = 10**9
while l < r:
    x = (l + r) // 2
    cnt = 0
    for i in range(n):
        cnt += a[i] // x
        if a[i] % x == 0:
            cnt -= 1
        if cnt > k:
            break
    if cnt <= k:
        r = x
    else:
        l = x
    print(l, r)
    if l + 1 == r:
        break
print(math.ceil((l + r) / 2))



import sys, bisect, math, itertools, heapq, collections
from operator import itemgetter

from functools import lru_cache
import copy
# @lru_cache(maxsize=None)

input = sys.stdin.readline
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7

# region input function


def inp():
    
    return int(input())


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


def str_inp():
    
    return list(input()[:-1])




n, k = inpl()
a = inpl()

l = 0
r = 10**9
while l + 1 < r:
    x = (l + r) // 2
    cnt = 0
    for i in range(n):
        cnt += math.ceil(a[i] / x) - 1
        if cnt > k:
            break
    if cnt <= k:
        r = x
    else:
        l = x
print(r)


Verdicts: Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):

def can_or_cannot(A,K,x):
    kaisuu_sum = 0
    for i in range(len(A)):
        if A[i]%x == 0:
            temp = (A[i]%x) - 1
            kaisuu_sum += temp
        else:
            temp = A[i]//x
            kaisuu_sum += temp

        if kaisuu_sum > K:
            return 'No'

    return 'Yes'

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    
    left = 0
    right = A[N-1]
    mid = 0
    while True:
        mid = int( (left + right)/2 )
        judge = can_or_cannot(A,K,mid)
        if judge == 'No':
            left = mid+1
        elif judge == 'Yes':
            right = mid

        if left == right:
            return right

print(main())



def can_or_cannot(A,K,x):
    kaisuu_sum = 0
    for i in range(len(A)):
        if A[i]%x == 0:
            temp = (A[i]//x) - 1
            kaisuu_sum += temp
        else:
            temp = A[i]//x
            kaisuu_sum += temp

        if kaisuu_sum > K:
            return 'No'

    return 'Yes'

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    
    left = 0
    right = A[N-1]
    mid = 0
    while True:
        mid = int( (left + right)/2 )
        print(left,mid,right)
        judge = can_or_cannot(A,K,mid)
        print(left,mid,right,judge)
        if judge == 'No':
            left = mid+1
        elif judge == 'Yes':
            right = mid

        if left == right:
            print(left,mid,right)
            return right

print(main())



def can_or_cannot(A,K,x):
    kaisuu_sum = 0
    for i in range(len(A)):
        if A[i]%x == 0:
            temp = (A[i]//x) - 1
            kaisuu_sum += temp
        else:
            temp = A[i]//x
            kaisuu_sum += temp

        if kaisuu_sum > K:
            return 'No'

    return 'Yes'

def main():
    N,K = map(int,input().split())
    A = list(map(int,input().split()))
    A.sort()
    
    left = 0
    right = A[N-1]

    if right == 1:
        return 1

    mid = 0
    while True:
        if right == 1:
            return 1
            
        mid = int( (left + right)/2 )
        #print(left,mid,right)
        judge = can_or_cannot(A,K,mid)
        #print(left,mid,right,judge)
        if judge == 'No':
            left = mid+1
        elif judge == 'Yes':
            right = mid

        if left == right:
            #print(left,mid,right)
            return right

print(main())


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

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


def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1


"""cut length N binary search
if cut num > K, search more longer cut length,
"""
l = 1
r = max(As)

ans = r
while True:
    m = (l+r)//2
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m

    if r - l < 1:
        break

if sum([cut_num(a, l) for a in As]) <= K:
    print(l)
else:
    print(r)

import math
N, K = map(int, input().split())
As = list(map(int, input().split()))


def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1


"""cut length N binary search
if cut num > K, search more longer cut length,
"""
l = 1
r = max(As)

while r > l + 1:
    m = (l+r)//2
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        r = m
    else:
        l = m
    

if sum([cut_num(a, l) for a in As]) <= K:
    print(l)
else:
    print(r)

Verdicts: Time Limit Exceeded

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
import math

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

def is_ok(x,a,k):
    b = 0
    for ai in a:
        b += math.ceil(ai/x)
        b -= 1
    print(x,b)
    if b <= k:
        return True

def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid,a,k):
            ok = mid
        else:
            ng = mid
    return ok


print(meguru_bisect(0,max(a)))

import math

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

def is_ok(x,a,k):
    b = 0
    for ai in a:
        b += math.ceil(ai/x)
        b -= 1
    if b <= k:
        return True

def meguru_bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if is_ok(mid,a,k):
            ok = mid
        else:
            ng = mid
    return ok


print(meguru_bisect(0,max(a)))

Verdicts: Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

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

l = 1
r = 10**9 + 1

import math
while l < r:
    mid = (l + r) // 2
    counter = 0
    for i in range(N):
        if A[i] > mid:
            counter += math.ceil(A[i]/mid) - 1
    if counter <= K:
        r = mid - 1
    else:
        l = mid

print(l)

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

l = 1
r = 10**9 + 1

import math
while l < r:
    mid = (l + r) // 2
    counter = 0
    for i in range(N):
        if A[i] > mid:
            counter += math.ceil(A[i]/mid) - 1
    if counter <= K:
        r = mid
    else:
        l = mid + 1

print(l)

Verdicts: Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
import sys
import math

input = sys.stdin.readline

def can(arr, m, K):
  need = 0
  for x in arr:
    need += int(x // m)
  return need <= K


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

lo = 0.0
hi = 1e9

for i in range(25):
  m = (lo + hi) / 2.0
  if (can(arr, m, K)):
    hi = m
  else:
    lo = m
ans = lo

print(int(math.ceil(lo)))
  
  



import sys
import math

input = sys.stdin.readline

def can(arr, m, K):
  need = 0
  for x in arr:
    if x > m:
      need += int(x // m)
  return need <= K

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

lo = 1
hi = int(1e9) + 1

while (lo < hi):
  m = int((lo + hi) // 2)
  if (can(arr, m, K)):
    hi = m
  else:
    lo = m + 1
print(lo)


Verdicts: Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
n, k = map(int, input().split())
arr = np.array(list(map(int, input().split())))

l = 1
r = max(arr)

while l + 1 < r:
    m = (l + r) // 2

    cut = 0
    for x in arr:
        cut += (x - 1) // m

    if cut > k:
        l = m
    else:
        r = m

print(r)

n, k = map(int, input().split())
arr = list(map(int, input().split()))

l = 0
r = max(arr)

while l + 1 < r:
    m = (l + r) // 2

    cut = 0
    for x in arr:
        cut += (x - 1) // m

    if cut > k:
        l = m
    else:
        r = m

print(r)

Verdicts: Runtime Error

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

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

A.sort(reverse=True)

left = 0
right = A[0]

while right - left > 1:
    mid = (left + right) // 2
    jk = 0
    for i in range(N):
        jk += math.ceil( A[i] / mid)
    if jk < K:
        right = mid
    else:
        left = mid

print(right)

import math

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

left = 0
right = max(A)

while right - left > 1:
    mid = (left + right) // 2
    jk = 0
    for i in range(N):
        jk += A[i] // mid - 1
        if A[i] % mid != 0: jk += 1
    if jk <= K:
        right = mid
    else:
        left = mid

print(right)

Verdicts: Runtime Error

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
import math
n,k=map(int, input().split())
a=list(map(int, input().split()))
right=10**9
left=0
def cutable(a,x):
    count=0
    for i in a:
        count+=math.ceil(i/x)-1
    return count<=k    
while right>left+1:
    mid=(right+left)//2
    if cutable(a,mid):
        left=mid
    else:
        right=mid+1
print(math.ceil(max(a)/left))

import math
n,k=map(int, input().split())
a=list(map(int, input().split()))
right=max(a)
left=0
def cutable(a,x):
    count=0
    for i in a:
        count+=math.ceil(i/x)-1
    return count<=k
while right>left+1:
    mid=(right+left)//2
    if cutable(a,mid):
        right=mid
    else:
        left=mid
print(right)

Verdicts: Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
from heapq import heappush, heappop, heapify
import math
def solve():
	n , k= map(int, input().strip().split())
	a= [(-int(x),1,int(x)) for x in input().strip().split()]
	heapify(a)
	slices = 0
	while slices < k:
		x,cnt,orig = heappop(a)
		if x == -1:
			return 1
		x = -x-1
		print(x)
		if (orig+cnt)//(cnt+1) > x:
			if slices +(orig+x-1)//x >= k:
				return x+1
			else:
				cnt_t = (orig+x-1)//x
				slices += cnt_t - cnt
				heappush(a,(-x,cnt,orig))
		else:
			heappush(a,(-((orig+cnt)//(cnt+1)),cnt+1,orig))
			slices+=1
	return -(heappop(a)[0])


print(solve())

from heapq import heappush, heappop, heapify
import math
def solve():
	n , k= map(int, input().strip().split())
	a= [(-int(x),1,int(x)) for x in input().strip().split()]
	heapify(a)
	for i in range(k):
		x,cnt,orig = heappop(a)
		if x < 1:
			return 1
		heappush(a,(-((orig+cnt)//(cnt+1)),cnt+1,orig))
	return -(heappop(a)[0])


print(solve())

from heapq import heappush, heappop, heapify
import math
def check(a,mid,k):
	cnt = 0
	for x in a:
		cur_cnt = (x+mid-1)//mid - 1
		cnt+=cur_cnt
		if cnt > k:
			return False
	return True

def solve():
	n , k= map(int, input().strip().split())
	a= [int(x) for x in input().strip().split()]
	l = 0
	r = 10**9+20
	while r-l > 1:
		mid = (r+l)//2
		if check(a,mid,k):
			r = mid
		else:
			l = mid
	return l+1
 
print(solve())

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
n,k = map(int,input().split())
L = list(map(int,input().split()))
ok = 0
ng = 10**9
while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    cur = 0
    for i in range(n):
        cur += L[i]//mid
    if cur > k:
        ok = mid
    elif cur <= k:
        ng = mid
    print(mid,cur)
K = [mid-1, mid, mid+1]
P = []
for i in range(3):
    res = 0
    for j in range(n):
        res += (L[j]-1)//K[i]
    if res <= k:
        P.append(K[i])
print(min(P))

n,k = map(int,input().split())
L = list(map(int,input().split()))
ok = 0
ng = 10**9
while abs(ok-ng) > 1:
    mid = (ok+ng)//2
    cur = 0
    for i in range(n):
        cur += L[i]//mid
    if cur > k:
        ok = mid
    elif cur <= k:
        ng = mid
K = [mid-1, mid, mid+1]
P = []
for i in range(3):
    res = 0
    if K[i] > 0:
        for j in range(n):
            res += (L[j]-1)//K[i]
        if res <= k:
            P.append(K[i])
print(min(P))


Verdicts: Runtime Error

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
h,w,m=map(int,input().split())
bomb=[]
x=[0]*(h+1)
y=[0]*(w+1)
for i in range(m):
    h1,w1=map(int,input().split())
    x[h1]+=1
    y[w1]+=1
    bomb.append((h1,w1))
maxx=max(x)
maxy=max(y)
r=[]
c=[]
for i in range(1,h+1):
    if x[i]==maxx:
        r.append(i)
for j in range(1,w+1):
    if y[i]==maxy:
        c.append(i)
for j in r:
    for k in c:
        if (j,k) not in bomb:
            print(maxx+maxy)
            exit()
print(maxx+maxy-1)

n,k=map(int,input().split())
a=list(map(int,input().split()))
ng=0
ok=max(a)+1
while ok-ng>1:
    mid=(ng+ok)//2
    count=0
    for i in range(n):
        if a[i]%mid==0:
            count+=((a[i]//mid)-1)
        else:
            count+=(a[i]//mid)
    if count>k:
        ng=mid
    else:
        ok=mid
print(ok)

Verdicts: Runtime Error

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):


# import sys


# from collections import deque
import math
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, K, As):
    ans = max(As)
    l, r = 1, ans
    for _ in range(30):
        m = (l + r) // 2
        cnt = 0
        for A in As:
            cnt += math.ceil(A / m) - 1
        if cnt <= K:
            ans = min(ans, m)
            r = m - 1
        else:
            l = m + 1
        if l == r:
            break
    print(ans)


if __name__ == '__main__':
    # S = input()
    # N = int(input())
    N, K = map(int, input().split())
    As = [int(i) for i in input().split()]
    
    solve(N, K, As)




# import sys


from collections import deque
from decorator import stop_watch
import math


@stop_watch
def solve(N, K, As):
    ans = max(As)
    l, r = 1, ans
    for _ in range(30):
        m = (l + r) // 2
        cnt = 0
        for A in As:
            cnt += math.ceil(A / m) - 1
        if cnt <= K:
            ans = min(ans, m)
            r = m - 1
        else:
            l = m + 1
    print(ans)


if __name__ == '__main__':
    # S = input()
    # N = int(input())
    N, K = map(int, input().split())
    As = [int(i) for i in input().split()]
    
    solve(N, K, As)




# import sys


# from collections import deque
import math
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, K, As):
    ans = max(As)
    l, r = 1, ans
    for _ in range(30):
        if l == r:
            break
        m = (l + r) // 2
        cnt = 0
        for A in As:
            cnt += math.ceil(A / m) - 1
        if cnt <= K:
            ans = min(ans, m)
            r = m - 1
        else:
            l = m + 1
    print(ans)


if __name__ == '__main__':
    # S = input()
    # N = int(input())
    N, K = map(int, input().split())
    As = [int(i) for i in input().split()]
    
    solve(N, K, As)




# import sys


# from collections import deque
import math
# from decorator import stop_watch
#
#
# @stop_watch
def solve(N, K, As):
    ans = max(As)
    l, r = 1, ans
    for _ in range(30):
        m = (l + r) // 2
        cnt = 0
        for A in As:
            cnt += math.ceil(A / m) - 1
        if cnt <= K:
            ans = min(ans, m)
            r = m - 1
        else:
            l = m + 1
        if l > r:
            break
    print(ans)


if __name__ == '__main__':
    # S = input()
    # N = int(input())
    N, K = map(int, input().split())
    As = [int(i) for i in input().split()]
    
    solve(N, K, As)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
def f(x):
    now = 0
    for i in range(n):
        now += (a[i]-1)//x

    return now <= k

n, k = map(int, input().split())
a = list(map(int, input().split()))
ng = 0
ok= 1e9
while ok - ng > 1:
    x = (ok + ng) // 2
    if f(x):
        ok = x
    else:
        ng = x

print(ok)

def f(x):
    now = 0
    for i in range(n):
        now += (a[i]-1)//x

    return now <= k

n, k = map(int, input().split())
a = list(map(int, input().split()))
ng = 0
ok= int(1e9)
while ok - ng > 1:
    x = (ok + ng) // 2
    if f(x):
        ok = x
    else:
        ng = x

print(ok)

Verdicts: Wrong Answer

Accepted
Problem: We have N logs of lengths A_1,A_2,\cdots A_N.  We can cut these logs at most K times in total. When a log of length L is cut at a point whose distance from an end of the log is t (0<t<L), it becomes two logs of lengths t and L-t.  Find the shortest possible length of the longest log after at most K cuts, and print it after rounding up to an integer.

Submission attempts (in order):
import math
n, k = map(int, input().split())
aas = list(map(int, input().split()))
diff = pow(10,-6)
left = 1
right = 10**9
def judge(mid):
    cut = 0
    for i in aas:
        cut += math.ceil(i / mid) - 1
    if cut <= k:
        return True
    else:
        return False
while left < right:
    mid = (left + right) / 2
    if (left <= right <= left + diff) or (right <= left <= right + diff):
        break
    elif judge(mid):
        right = mid
    else:
        left = mid
print(int(right))

import math
n, k = map(int, input().split())
aas = list(map(int, input().split()))
diff = pow(10,-6)
left = 1
right = 10**9
def judge(mid):
    cut = 0
    for i in aas:
        cut += math.ceil(i / mid) - 1
    if cut <= k:
        return True
    else:
        return False
while left < right:
    mid = (left + right) / 2
    if (left <= right <= left + diff) or (right <= left <= right + diff):
        break
    elif judge(mid):
        right = mid
    else:
        left = mid
print(math.ceil(left))

Verdicts: Wrong Answer

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

Submission attempts (in order):
int = int(input())
print(a*a*a+a*a+a)

i = int(input())
print(i*i*i+i*i+i)

Verdicts: Runtime Error

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

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

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

a = int(input())

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
n=int(input())
 
ans=0
for i in range(n):
  i=i+1
  a=i
  y=n//i
 
  ans+=(i*y*(y+1)/2)
 
 
 
print(ans)

a=int(input())
print(a+a**2+a**3)

Verdicts: Wrong Answer

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

Submission attempts (in order):
a=input()
print(a+a**2+a**3)

a=input()
print(int(a+a**2+a**3))


a=input()
a=int(a)
print(int(a+a**2+a**3))


Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
a = int(input())
ans = a + a * a + a * a * a
print(ans)a = int(input())


a = int(input())
ans = a + a * a + a * a * a
print(ans)

Verdicts: Runtime Error

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

Submission attempts (in order):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


ans = 0
k = make_divisors(int(input()))
l = len(k)
for i in range(1,l):
    ans = ans + k[i] * i 
print(ans)

N = int(input())
A = N + N**2 + N**3
print(A)

Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
print(a+a**2+a**3)

a = int(input())
print(a+a**2+a**3)

Verdicts: Runtime Error

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

Submission attempts (in order):
n=int(input())
print(a+a**2+a**3)

a=int(input())
print(a+a**2+a**3)


Verdicts: Runtime Error

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

Submission attempts (in order):
a=input()
b=a**3+a**2+a
print(b)

a = int(input())
b = a ** 3 + a ** 2 + a
print(b)


Verdicts: Runtime Error

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

Submission attempts (in order):
a = int(input())
print(a + a**2 + a***3)

a = int(input())
print(a + a**2 + a**3)

Verdicts: Runtime Error

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

Submission attempts (in order):
a=input()
print(a+a**2+a**3)

a=int(input())
print(a+a ** 2+a ** 3)

Verdicts: Runtime Error

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

Submission attempts (in order):
a=int(input())
print(a+a^2+a^3)

a=int(input())
print(a+a**2+a**3)

Verdicts: Wrong Answer

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

Submission attempts (in order):
a = input()
ans = a + (a ** 2) + (a ** 3)
print(ans)

a = int(input())
ans = a + (a ** 2) + (a ** 3)
print(ans)

Verdicts: Runtime Error

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

Submission attempts (in order):
a=int(input())
value=a+(a*a)+(a*a*a*)
print(value)

a=int(input())
if(a>=1 and a<=10):
    val=a+(a*a)+(a*a*a)
    print(val)

Verdicts: Runtime Error

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

Submission attempts (in order):
a = int(input())
ans = (a + (a**2) + (a**3))

a = int(input());print(a + a**2 + a**3)

Verdicts: Wrong Answer

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

Submission attempts (in order):
def solve(string):
    a = int(string)
    return str(a + a**2 + a**3)                                                                                         

if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
~                                                                                                                       ~                                                                                                                       ~                                                                                                                       ~                                                                                                                       ~                                                    

def solve(string):
    a = int(string)
    return str(a + a**2 + a**3)                                                                                         

if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))
~                                                                                                                       ~                                                                                                                       ~                                                                                                                       ~                                                                                                                       ~                                                    

def solve(string):
    a = int(string)
    return str(a + a**2 + a**3)                                                                                         

if __name__ == '__main__':
    import sys
    print(solve(sys.stdin.read().strip()))


Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
a = int(input())
print(a+a^2+a^3)

a = int(input())
print(a+a**2+a**3)

Verdicts: Wrong Answer

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

Submission attempts (in order):
print(int(a+a**2+a**3))

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

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

a=int(input())
print(a+a**2+a**3)

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
a = int(input()
print(a + a**2 + a**3)

a = int(input())
print(a + a**2 + a**3)

Verdicts: Runtime Error

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

Submission attempts (in order):
a = int(input())
print("a+a*a+a*a*a")

a = int(input())
print(a + a * a + a * a * a)

Verdicts: Wrong Answer

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

Submission attempts (in order):
n, m, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
 
l = []
for i in range(min(n, m)):
  l.append(min(a[i], b[i]))
  l.append(max(a[i], b[i]))

for i in range(min(n, m), max(n, m)):
  if n > m:
    l.append(a[i])
  else:
    l.append(b[i])

total = 0
cnt = 0
for i in range(n+m):
  if total+l[i] > k:
    break
  total += l[i]
  cnt += 1
print(cnt)

s = int(input())
print(s + s**2 + s**3)

Verdicts: Runtime Error

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

Submission attempts (in order):
a=int((input())
print(a+a**2+a**3)

a=int((input())
print(a+a^2+a^3)

a=int((input())
print(a+a^2+a^3)

a=int(input())
print(a+a**2+a**3)

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
s = int(input())
val = 0
for i in range(1,4):
  a = s**i
  val +=a
  print(val)
  

s = int(input())
print(s**1+s**2+s**3)

Verdicts: Wrong Answer

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

Submission attempts (in order):
a = int(input())
out = a + a^2 + a^3
print(out)

a = int(input())
out = a + a**2 + a**3
print(out)

Verdicts: Wrong Answer

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

Submission attempts (in order):
S = input()
T = input()

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

print(count)

a = int(input())

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

Verdicts: Runtime Error

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

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

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

main()

Verdicts: Runtime Error

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

Submission attempts (in order):
a=int(input())
if 1<=a<=10:
print(a+a**2+a**3)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
N,M,K=map(int,input().split())
Ai=list(map(int,input().split()))
Bi=list(map(int,input().split()))
list=[]
for i in range(N+M):
    if A[i]>B[i]:
        list.append(B[i])
    else:
        list.append(A[i])
        if sum(list)>=K:
            break
print(len(list))

a=int(input())
print(a+a**2+a**3)

Verdicts: Runtime Error

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

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

N = int(input())
ans = 0
for j in range(1, N+1):
    for i in range(1, N+1):
        if i % j == 0:
            ans += i
print(ans)

import re
import sys
try:
  a = int(input())
  if not 1 <= a <= 10:
    sys.exit()
  print(a+(a**2)+(a**3))
except:
  sys.exit()

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
a = int(input())
print(a*(a**2)*(a**3))

a = int(input())
print(a+(a**2)+(a**3))

Verdicts: Wrong Answer

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

Submission attempts (in order):
a = input()
print(a + a*a + a*a*a)

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

def main():
    a = int(input())
    print(a + a*a + a*a*a)
    
if __name__ == "__main__":
    main()

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
n,m,k = map(int,input().split())
book_list = list(map(int,input().split()))
book_list.extend(list(map(int,input().split())))
book_list.sort()
count=0
readTime=0
for i in range(n+m):
    if readTime+book_list[i]<=k:
        count+=1
        readTime+=book_list[i]
    else:
        break
print(count)

x=int(input())
print(x+x**2+x**3)

Verdicts: Runtime Error

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

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

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

a=int(input())
 
b=a+(a**2)+(a**3)
print(b)

Verdicts: Runtime Error

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

Submission attempts (in order):
a=input()
x=a+a*a+a*a*a
print(a)

a=input()
print(a+a*a+a*a*a)

num = int(input())
num2 = num + num*num+num*num*num
print(num2)

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
x = int(import())
print(x+x*x+x*x*x)

x = int(input())
print(x+x*x+x*x*x)

Verdicts: Runtime Error

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

Submission attempts (in order):
a = input()
print(a+(a*a)+(a*a*a))


a = int(input())
print(a+(a*a)+(a*a*a))


Verdicts: Runtime Error

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

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

ans = a+a*2+a*3

print ans


a = int(input())

ans = a+a*2+a*3

return ans


a = int(input())

ans = a+a*2+a*3

print(ans)

a = int(input())

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

print(ans)

a = int(input())

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

return ans


a = int(input())

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

print(ans)

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

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

Submission attempts (in order):
a = input()
n = 2
m = 3
print(a + a**n + a**m)

a = input()
n = 2
m = 3
print(a+a**n+a**3)

a = input()
print(a+a^2+a^3)

a = input()
n = 2
m = 3
print(a + a ** n + a ** m)

a = int(input())
n = 2
m = 3
print(a + a ** n + a ** m)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main(N):
    x = 0
    for a in range(1, N+1):
        for b in range(a, N+1, a):
            x += b
    return x

if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    i8 = numba.int64
    cc = CC('my_module')

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    main = cc_export(main, (i8, ))
    cc.compile()

from my_module import main

N = int(read())
print(main(N))


import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x = int(read())
print(x + x * x + x * x * x)

Verdicts: Wrong Answer

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

Submission attempts (in order):
a = input()
return a + a ** a + a ** a ** a

a = int(input())
a + a ** 2 + a ** 3

return a + a ** a + a ** a ** a

a = int(input())
return a + a ** 2 + a ** 3

a = input()
return a + a ** 2+ a ** 3

a = int(input())
b = a + a ** 2 + a ** 3
print(b)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
print(a + (a*a) + (a*a*a))

a = int(input())
print(a + (a * a) + (a * a * a))

Verdicts: Runtime Error

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

Submission attempts (in order):
num = input()
print(num + (num*num) + (num*num*num))

num = int(input())
print(num + (num*num) + (num*num*num))

Verdicts: Runtime Error

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

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

def main():
    a = int(input())

    print(a + (a ** 2) + (a ** 3))
 
if __name__ == '__main__':
    main()

Verdicts: Runtime Error

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

Submission attempts (in order):
a, b = [input() for i in range(2)]

count = 0
out = 0
if a == b:
  print("0")
else:
  c = list(a)
  d = list(b)
  for i in c:
    if i == d[count]:
      pass
    else:
      out = out + 1
    count = count + 1
  print(str(out))

a = int(input())
 
print(str(a + (a ** 2) + (a ** 3)))

Verdicts: Runtime Error

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

Submission attempts (in order):
int a
int x
x = a+(a*a)+(a*a*a)
ptint(x)

a = int(input())
x = a+(a*a)+(a*a*a)
print(x)

Verdicts: Runtime Error

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

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

res = val + val ** 2 + val ** 3

print(res.astype(int))

val = input()

print(val + val ** 2 + val ** 3)

val = int(input())

print(val + val **2 + val **3)

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
import argparse


def main():
    parser = argparse.ArgumentParser()

    parser.add_argument('input', metavar='a', type=int)

    args = parser.parse_args()

    a = args.input

    print('{0}'.format(a+a*a+a*a*a))


if __name__ == '__main__':
    main()


import argparse

parser = argparse.ArgumentParser()

parser.add_argument('input', metavar='a', type=int)

args = parser.parse_args()

a = args.input

print('{0}'.format(a+a*a+a*a*a))

import argparse


def main():
    parser = argparse.ArgumentParser()

    parser.add_argument('input', metavar='a', type=int)

    args = parser.parse_args()

    a = args.input

    print('{0}'.format(a+a*a+a*a*a))


if __name__ == '__main__':
    main()

a = int(input())
print('{0}'.format(a+a*a+a*a*a))

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

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

a = int(input())
print(a+a**2+a**3)

Verdicts: Runtime Error

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

Submission attempts (in order):
import sympy
import sys
sys.setrecursionlimit(10**6)

N = int(input())
div = []
for i in range(1,N+1):
    f = sympy.divisor_count(i)
    div.append(f*i)

print(sum(div))

a = int(input())
print(a+a**2+a**3)

Verdicts: Runtime Error

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

Submission attempts (in order):
a=int(input())
print(a+a*a)+(a*a*a)

a = int(input())
print(a+a*a)+(a*a*a)

a = int(input())
print(a+a*a)(a*a*a)

a=int(input())
print(a+a*a)(a*a*a)

a = int(input())
print(a+(a*a)+(a*a*a))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

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

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)

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)

a=int(input())
print(a+a**2+a**3)

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

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

A_sum = [0]
B_sum = [0]
for i in range(N):
    A_sum.append(A_sum[i]+A[i])
for i in range(M):
    B_sum.append(B_sum[i]+B[i])


num = 0
J = M
for i in range(N+1):
    if A_sum[i] > K:
        break
    for j in (J,-1,-1):
        if A_sum[i] + B_sum[j] <= K:
            if num < i+j:
                num = i+j
            J = j
            break

print(num)


a = int(input())
print(a+a**2+a**3)

Verdicts: Runtime Error

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

Submission attempts (in order):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    a = 0
    print(a + a ** 2 + a **3)


if __name__ == '__main__':
    main()


import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))
ZIP = lambda: zip(*(MAP() for _ in range(n)))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    a = INT()
    print(a + a ** 2 + a **3)


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

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

Submission attempts (in order):
def main():
    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)
    a, b = a[::-1], b[::-1]
    sum = 0
    for _ in range(400001):
        x = a.pop() if a[-1] < b[-1] else b.pop()
        if x > 10**9:
            break
        k -= x
        if k < 0:
            break
        sum += 1
    print(sum)

if __name__ == "__main__":
    main()


def main():
    a = int(input())
    ans = a + a**2 + a**3
    print(ans)


if __name__ == "__main__":
    main()


Verdicts: Runtime Error

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

Submission attempts (in order):
a = input()
my_result = a + a*a + a*a*a
print(my_result)

a = input()
my_result = a + a**2 + a**3
print(my_result)

a = int(input())
my_result = a + a**2 + a ***3
my_result

a = int(input())
my_result = a + a**2 + a**3
print(my_result)

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
a = int(input())
ans = a*(1+a+a*a*)
print(ans)

a = int(input())
ans = a + a^2 + a^3
print(ans)

a = int(input())
ans = a + (a*a) + (a*a*a)
print(ans)

Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
x=input()
print(x+(int)(pow(x,2)+(int)(pow(x,3)))

x=(int)(input())
y=x+(int)(pow(x,2))+(int)(pow(x,3))
print("{}".format(y))

Verdicts: Runtime Error

Accepted