TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Compute A \times B.

Submission attempts (in order):

A,B = input().split()
A = int(A)
B = int(B[0]+B[2:])
print(A*B//100)


A, B = map(int, input().split())
print(A*B)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b=int(map(int,input().split()))
print(a*b)

a,b=map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a, b = list(map, input().split())
print(a * b)

a, b = int(input())
total = a * b
print(total)

a, b = map(int,input().split())
print(a * b)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b=map(input().split())
print(a*b)

a,b=map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A,B=input().split()
A=int(A)
B=B[0]+B[2:]
B=int(B)
print(int(A*B/100))

A,B=map(float,input().split())
B_2=int(B*100)
A_2=int(A)
print(A_2*B_2//100)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

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

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

print(a[0]*a[1])

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
print(int(input())*int(input()))


data = input().split()
print(int(data[0])*int(data[1]))

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
N=int(input())
A = [int(x) for x in input().split()]

ans=1
if 0 in A:
    ans = 0
else:
    for a in A:
        A.reverse()
        if a > 10**18:
            ans = -1
            break
        else:
            ans *= a
            if ans > 10**18:
                ans = -1
                break
print(ans)

                


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

print(A*B)

A,B=map(int,input())

print(A*B)

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

print(A*B)

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

print(A*B)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b=map(int,input().split())
print(a*b9)

a,b=map(int,input().split())
print(a*b9

a,b=map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

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

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

n = 1

for i in a:
    n *= i
    if n > 10**18:
        print('-1')
        break
else:
    print(n)


a = list(map(int,input()))

print(a[0]*a[1])

a,b = map(int,input())
print(a*b)

a,b = map(int,input())

print(a*b)

a = lsit(map(int,input().split()))

print(a[0]*a[1])

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

print(a*b)

a,b = map(int,input())

print(a*b)

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

print(a[0]*a[1])

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a, b = list(map(int, input()))

print(a*b)

a, b = list(map(int, input().split()))
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

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

result = 1
flag = 0
for x in range(N):
  result *= i[x]
  if(result>pow(10,18)):
    result = -1
    flag = 1
    break

if(flag==0):
  print(result)
else:
  print('-1')






i = list(map(int, input().split()))
print(i[0]*i[1])

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a, b = input().split()

print(a*b)

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

print(a*b)

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

print(a*b)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A, B = int(input().split())
print(A*B)

A, B = map(int, input().split())
print(A*B)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
N, M = map(int, input().split())
purint(N * M)

N, M = map(int, input().split())
print(N * M)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A=eval(input().replace('.','').replace(' ','*'))
print(int(A/100))

A,B=map(int,input().split())
print(A*B)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b=input().split()
a=int(a)
b=float(b)*100
 
print((a*b)//100)

from decimal import Decimal

a,b=input().split()
print(int(Decimal(a)*Decimal(b)))

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = input().split()

print(a * b)

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

print(a*b)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A B = list(map(int,input().split()))
print(A * B)

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

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = list(map(float, input().split()))
aint = int(a)
print('{}'.format(round(aint * number[1])))


number = int(input()).split('')
print(number[0] * number[1])

number = list(map(float, input().split()))
print('{}'.format(round(int(number[0]) * number[1])))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a=int(input())
b=input().split(' ')
m=0
s=1
while m<a:
    s=s*int(b[m])
    m=m+1
    if s>10**18:
        print(-1)
        break

else:
    print(s)

a=input.split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
print(a[0]*a[1])

a=input().split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
print(a[0]*a[1])

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a=int(input())
li = list(map(int,input().split()))
 
result = 1
for num in li:
  result = result * num
  if result > 10 ** 18:
    print(-1)
    
print(result)

x,y = map(int,input().split())
print(x * y)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n = int(input())
r = list(map(int,input().split()))

for i in range(n):
    if i == 0:
        x = r[i]
    else:
        x = x * r[i]
    
    if x >= 10**19:
        x = -1
        break

if x > 10**18:
        x = -1
print(int(x))

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

y = int(a[0]) * int(a[1])
print(y)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = (int,input(). split ())
print(a*b)

a=input()
b=input()

print(a*b)

a,b = map(int,input(). split ())
print(a*b)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A, B = map(int, input.split())
print(A*B)

A, B = map(int, input().split())
print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
def kake(b,c):
    return b * c

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

A = 1
for i in range(n):
    kake(A,a[i])

if A>1000000000000000000:
        print(-1)
else:
    print(A)

A,B = input().split()
A = int(A)
B = int(B)
print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):


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

print(a)
print(b)

answer = a * b

print(answer)


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

print(a)
print(b)

answer = a * b

print(answer)


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

answer = a * b

print(answer)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a=int(input())
li = list(map(int,input().split()))
 
n=1
for i in li:
	n=n*i
	if(n>1000000000000000000):
		n=-1
		break
print(n)

a=int(input())
li = list(map(int,input().split()))
 
n=1
for i in li:
	n=n*i
	if(n>1000000000000000000):
		n=-1
		break
print(n)

x,y = map(int,input().split())	
print(x*y)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
x=int(input())
y=int(input())
print(x*y)

x,y=map(int,input().split())
print(x*y)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b=int(input().split())
print(a*b)

a,b=map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a = int(input().split())
print(a[0]*a[1])

a,b = int(input().split())
print(str(a*b))

a,b = int(input().split())
print(a*b)

a, b = input().split()
print(int(a)*int(b))

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a, b= map(int(input().split())
print (a*b)



a, b= map(int, input().split())
print (a*b)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
def main():
  A,B = input().split()
  
  a = int(A)
  b = float(B)
  
  c = int (b*100)
  
  ans = a*c/100
  print(ans)
  
main()

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

print(A*B)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
count = int(input())
if count == 0:
  result = 0
else:
  nums_str = input().split()
  nums_int = []
  for strn in nums_str:
    nums_int.append(int(strn))
 
    result = 1

    if 0 in nums_int:
      result = 0
    else:
      for intn in nums_int:
        result *= intn
        if result > 1000000000000000000:
          result = -1
          break
    
print(result)

nums = input()
num1 = int(nums.split()[0])
num2 = int(nums.split()[1])

print(num1 * num2)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
import numpy as np;
from numba import jit
import warnings
from operator import mul
from functools import reduce
warnings.simplefilter('ignore')
    

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    ans = reduce(mul, A)
    if ans > 10 ** 18:
        print(-1)
    else:
        print(ans)

from fractions import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import product, combinations, permutations
from copy import deepcopy
import sys
import numpy as np
sys.setrecursionlimit(4100000)



if __name__ == '__main__':
    print("hello")

import numpy as np;




if __name__ == '__main__':
    a, b = map(int, input().split())
    print(a*b)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Compute A \times B.

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

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

count = 1

for i in a:
    count*=i

x = 10**18

if count > x:
    print(-1)
    break
else:
    print(count)

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

print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n=int(input())
ans=0
r=int(n**0.5)+1
for i in range(2,r):
    if n%i==0:
        ans+=1
        n/=i
if ans==0 and not n==0:
    ans=1
print(ans)

a,b=map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
 a,b=(int(x) for x in input().split())
 
 print(a*b)
                                                                                          
                                                                                          
                                                                                          
        

a,b=(int(x) for x in input().split())

print(int(a*b))
                                                   
                                                   
                                                   

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = map(int,input().split())

print(a * B)

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

print(a * b)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
import math
A, B = input().split()
A = int(A)
B = int(B.replace('.', ''))
 
print(A*B//100))

A, B = [int(_) for _ in input().split()]
print(A*B)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

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

sum = 0
i = 0

for i in range(n+1):
  x = int(input())
  sum *= x
  i += 1
  
  if sum > 10 ** 18:
    print(-1)
    break
    
print(sum)


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

print(a * b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = map(int,input().split())
print(a+b)

a,b = map(int,input().split())
print(a*b)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

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

ans = 1
 
for i in A:
    ans *= i
    if ans > 10**18:
        ans = -1
        break
print(ans)


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

print(int(A*B))

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
import random

A = random.randint(1,100)
B = random.randint(1,100)
C = A*B
print(C)

A
B
A*B

input()
int_list = list(map(int, input().split()))
max_num = 10**18
ans = 1

if 0 in int_list:
   print(0)
   exit()
 
for i in int_list:
   ans *= i
   if ans > max_num:
       print(-1)
       break
else:
   print(ans)

A, B = int(input())
print(A*B)

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

T = 1 
for i in A:
    T = T * i
    if T > 10^18:
        print(-1)
    else:
        print(T)


A = int(input())
B = int(input())
print(A*B)

A = int()
B = int()
C = A*B
print(C)

A = int(input())
B = int(input())
print(A*B)

A = int(input())
B = int(input())
C = A*B
print(C)

A = int(input())
B = int(input())
A*B

A, B = map(int(input().split( )))
C = A*B
print(C)

A*B

a, b = map(int, input().split())
print(a*b)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a, b = int(map(input().split()))
print(a*b)

a, b = map(int, input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
N = int(input())
num = 1
flag = 0
c=list(map(int, input().split()))
for i in c:
    if i == 0:
        flag = 1
        print("0")
if flag == 0:
    for i in c:
        num *= i
    if num > 1000000000000000000:
        print("-1")
    else:
        print(num)

a,b=map(int, input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
N, M = map(int, input())

print(N*M)

N, M = map(int,input().split())
print(N*M)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
def main():
    A = int(input())
    B = int(input())
    ans = a(A, B)
    print(ans)

def a(A, B):
    return (A * B)

main()

def a(A B)
	return A * B

A = int(input())
B = int(input())
print(A*B)

A, B = map(int, input().split())
print(A*B)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a, b = map(int,input.split())
print(a*b)

a, b = map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A = int(input())
B = int(input())

print(A * B)

print(a)
print(b)

answer = a * b

print(answer)

a, b = map(int, input().split())
 
answer = a * b
 
print(answer)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

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

arr.sort()
res = 1
flg = True
for i in arr:
    res*=i
    if res >10**18:
        flg = False
        print('-1')
    # print(res, res >=10**18)
if(flg):print(res)


A,B = map(int,input().split())
print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A, B = map(int,input().split())
print("A*B")

A, B = map(int,input().split())
print(A*B)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A, B = map(int, input().split())
print (a*b)

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

print(A * B)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A, B = [int(x) for x in stdin.readline().rstrip().split()]
print(A * B)

from sys import stdin
A, B = [int(x) for x in stdin.readline().rstrip().split()]
print(A * B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n=input()
s=list(map(int,input().split())
sum=1
for i in s:
   sum=sum*i
if sum>10**18:
       print(-1)
else:
       print(sum)
       


x,y=map(int, input().split())
print(x*y)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = (int(input().split()))
print(a*b)

print(int(input())*int(input()))

a,b = (input().split())
print(int(a)*int(b))

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
N = int(input())
arr = list(map(int, input().split()))
result = 0
for i in range(N):
    if result == 0:
        result += arr[i]
    else:
        result *= arr[i]
if result > 10**18:
    print(-1)
else:
    print(result)

A, B = map(int, input().split())
print(A * B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a, b = map(str, input().split())
a = int(a)
b = int(float(b) //0.01)

print(int(a*b)//100)

a, b = map(int, input().split())
print(a*b)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n,m=map(str,input().split())
n=int(n)
m1=''
for i in m:
    if i=='.':
        continue
    else:
        m1+=i
print(n*int(m1)//100)

a,b=map(int,input().split())
print(a*b)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
import collections 
n=int(input()) 
a=[list(map(str,input().split())) for _ in range(n)]
l = []
for i in range(len(a)):
    l += list(a[i][0])



c = collections.Counter(l) 
let,num = zip(*c.most_common()) 
ll = list(num) 
for j in range(len(ll)):
    ll[j] //= 2


    
sum = 0
for jj in range(len(ll)):
    sum += ll[jj]

if sum < n//2:
    print(-1) 
else:
    ans = '' 
    for k in range(len(let)):
        ans += str(let[k]) * ll[k] 
    ans = ans[:n//2] 
    if n % 2 == 0:
        ans += ans[::-1] 
    else:
        ans += let[-1] + ans[::-1] 
    print(ans) 


#import math
#=input()
#=int(input())
a,b=map(int,input().split())
#=list(map(int,input().split()))
#=[list(map(int,input().split())) for _ in range()]

print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

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

import math
n=int(input())

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

f = factorization(n)
ans = 0
for i, j in f:
    ans += int((-1+pow(1+8*j,0.5))/2)
print(ans)

a, b = map(int, input().split())
print(a*b)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

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

a, b = map(int,input().split())
print(a * b)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n = int(input())
lim = 10**18
ans,exc = 1,False
for x in input().split():
  ans *= int(x)
  if ans > lim:
    exc = True
    print("-1")
if not exc:
  print(ans)

a,b = map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n, *l = map(int, open(0).read().split())

a = 1
for i in l:
	a *= i
	if a > 1e18:
		a = -1
		break
print(a)

n, *l = map(int, open(0).read().split())

a = 1
for i in l:
	a *= i
	if a > 1e18:
		a =-1
		break
ptint(a)

l = map(int, input())
 
a = 1
for i in l:
	a *= i
	if a > 1e18:
		a = -1
		break
print(a)

n = int(input())
l = list(map(int,input(). split ()))
 
a = 1
for i in l:
	a *= i
	if a > 1e18:
		a = -1
		break
print(a)

A, B = map(int, input().split())
print(A * B)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):

def main():
 a,b = int(input().split())
 print(a * b)
main()


def main():
 a,b = map(int,input().split())
 print(a)
main()

def main():
 a,b = map(int,input().split())
 print(a * b)
main()

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: Compute A \times B.

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

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

a=input()
a=a.split()
print(int(a[0])*int(a[1]))


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

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

A,B=map(int,input().split())
print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
ans = 1

if 0 in a: print('0')
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            print(-1)
        break
    print(ans)


a, b = map(int, input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
　

A,B = input().split()
A = int(A)
B = round(float(B)*100)
 
res = (A*B)//100
print(res)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
if __name__ == '__main__':
    n = int(input())
    arr = list(map(int, input().split()))
    product = arr[0]
    if 0 in arr:
        product = 0
    else:
        for i in range(1, n):
            product *= arr[i]
            if product > (10**18):
                product = -1
                break
    print(product)

if __name__ == '__main__':
    a, b = map(int, input().split())
    print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
N=int(input())
A=list(map(int,input().split()))
ans=1
if min(A)==0:
    ans=0
else:
    for a in A:
        ans=ans*a
    if ans > 10**18:
        ans = -1
print(ans)

A,B=map(int,input().split())
print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = (int(x) for x in input().split())
print(a + b)

a,b = (int(x) for x in input().split())
print(a * b)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A,B = int(input().split())
print(A*B)

A,B = input().split()
print(int(A)*int(B))

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A, B = int(input())
print(A*B)

A, B = (int(x) for x in input().split())
print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

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


a= int(input())
b= int(input())
c=a*b
print(c)

a,b = map(int(input().split()))
print(a*b)

a,b = map(input().split())
print(a*b)

a=int(input())
b=int(input())
c=a*b
print(c)

a,b= map(int,input.split())
print(a*b)

a,b= int(input())
c= a*b
print(c)

a,b = map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a = list(map(int, input().split()))
print(f"a[0] * a[1]")

a = list(map(int, input().split()))
print(f"{a[0] * a[1]}")

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n = int(input())
lst = list(map(int, input().split()))
mult = 1

for i in lst:
    mult *= i
    if mult > 10 ** 18:
        print(-1)
        exit()

print(mult)

a, b = map(int, input().split())
print(a * b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a, b = map(int,input().split())
pirnt(a * b)

a, b = map(int,input().split())
print(a * b)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A,B=int(input().split())
print(A*B)

a,b=map(int,input().split())
print(a*b)




Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
N = int(input())
a_lis = list(input().split())



ans=1
rough_power=0
for i in a_lis:
    rough_power+=len(i)-1

if rough_power>18:
    print("-1")
elif 0 in a_lis:
    print(0)
else:
    for j in a_lis:
        ans=ans*int(j)

    if ans>pow(10,18):
        print("-1")
    else:
        print(ans)

x,y = map(int, input().split())
ans = x*y
print(ans)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = map(int(input()).split())
print(a*b)

a, b = map(int(input(). split()))
print(a*b)

a,b = map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n = int(input())
li = list(map(int,input().split()))
a = 1
for i in range(n):
  a *= li[i]
if a > 10**18:
  print("-1")
else:
  print(a)

a, b = map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
N=int(input())
while True:
    try:
        listA=list(map(int,input().split()))
        #listA<-[1,2,2,3,1]
        
    except:
        break;

product=1
for i in listA:
  if product<10**18+1:
  	product=product*i
    
if listA.count(0)>0:
  print(0)
    
elif product<10**18+1:
  print(product)
  
elif product>=10**18+1:
  print(-1)


x,y = map(int,input().split()) 	
print(x*y)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = [int(e) for e in input().split(" ")]
print(a,b)

a,b = [int(e) for e in input().split(" ")]
print(a*b)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
a,b = map(int,input())
prin(a*b)

a,b = map(int,input().split())
print(a*b)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A = int(input())
B = int(input())
print(A*B)

A, B = map(int,input().split())
print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
vals = input.split()

a = int(vals[0])
b = int(vals[1])

print (a * b)

vals = [int(v) for v in input().split()]
print(vals[0] * vals[1])

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

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

a, b = list(map(int, input().split()))
print(a*b)


Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A, B = map(int, input().split())
1 <= A <= 100
1 <= B <= 100
print(a*b)

A, B = map(int, input().split())
1 <= A <= 100
1 <= B <= 100
print(A*B)

Verdicts: Runtime Error

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
A,B = (int(x) for x in input('A,B = ').split())
print(A*B)

A,B = map(int, input().split())
print(A*B)

Verdicts: Wrong Answer

Accepted
Problem: Compute A \times B.

Submission attempts (in order):
n = input()
t = n.split()

result = int(n[0]) * int(n[1])

x, y = map(int, input().split())

result = x * y 

print(result)


Verdicts: Runtime Error

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

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

c = 0

for l in range(k, n+2):
    c += l*(2*n + 1 - l)/2 - l*(l - 1)/2 + 1

print(c%(10^9 + 7))

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

c = 0

for l in range(k, n+2):
    c += l*(2*n + 1 - l)/2 - l*(l - 1)/2 + 1

print(c%(10**9 + 7))

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

c = 0

for l in range(k, n+2):
    c += l*(2*n + 1 - l)/2 - l*(l - 1)/2 + 1
    c %= 10**9+7

print(int(c%(10**9 + 7)))

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

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

for i in range(K,N+2):
    max = (N+(N-(i-1)))*i*(0.5)
    min = (0+(i-1))*i*0.5
    sum += max-min+1

print(sum%(10**9+7))


N,K = map(int,input().split())
sum = 0

for i in range(K,N+2):
    max = (N+(N-(i-1)))*i*(0.5)
    min = (0+(i-1))*i*0.5
    sum += max-min+1


print(int(sum%(10**9+7)))

Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
N, K = [int(i) for i in input().split()]
res = 0

for i in range(K, N + 2) :
	sum_lasti = i * (2 * N + 1 - i)/2 
	sum_firsti = ( i * i - i )/ 2 
	
	res += sum_lasti - sum_firsti + 1

print(res%1000000007)

N, K = [int(i) for i in input().split()]
res = 0

for i in range(K, N + 2) :
	sum_lasti = i * (2 * N + 1 - i)/2 
	sum_firsti = ( i * i - i )/ 2 
	
	res += sum_lasti - sum_firsti + 1

print(int(res%1000000007))


Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
import math
n, k = map(int,input().split())
total = 0
mod = 10**9+7
max_value = (n*(n+1)) //2
for a in range(k,n+1):
    high = (max_value-(n-(a*(a-1)) //2))
    low = (a*(a-1)) //2
    total += high - low + 1
total += 1 
print(total%mod)

import math
n, k = map(int,input().split())
total = 0
mod = 10**9+7
max_value = (n*(n+1)) //2
for a in range(k,n+1):
    high = (max_value-(n-a)*(n-a+1)//2)
    low = (a*(a-1)) //2
    total += high - low + 1
total += 1 
print(total%mod)

Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
N, K = map(int, input().split())
ans = 0
for k in range(K, N+1):
  mi = k*(k-1)//2
  ma = k*(2*N-k+1)//2
  ans += ma - mi + 1
  ans %= 1000000007
print(ans)


N, K = map(int, input().split())
ans = 0
for k in range(K, N+2):
  mi = k*(k-1)//2
  ma = k*(2*N-k+1)//2
  ans += ma - mi + 1
  ans %= 1000000007
print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
    n, k = map(int, input().split())
    if n < k:
        print(1)
        exit(0)

    MOD = pow(10, 9) + 7
    count = 0
    while n+1 >= k:
        minv = k * (k-1) // 2
        maxv = ((n+1) * n // 2) - ((n-k) * (n-k+1) // 2)

        count += (maxv - minv + 1)
        count %= MOD
        k += 1

    print(count)


n, k = map(int, input().split())
if n < k:
    print(1)
    exit(0)

MOD = pow(10, 9) + 7
count = 0
while n+1 >= k:
    minv = k * (k-1) // 2
    maxv = ((n+1) * n // 2) - ((n-k) * (n-k+1) // 2)

    count += (maxv - minv + 1)
    count %= MOD
    k += 1

    print(count)


n, k = map(int, input().split())
if n < k:
    print(1)
    exit(0)

MOD = pow(10, 9) + 7
count = 0
while n+1 >= k:
    minv = k * (k-1) // 2
    maxv = ((n+1) * n // 2) - ((n-k) * (n-k+1) // 2)

    count += (maxv - minv + 1)
    count %= MOD
    k += 1

print(count)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
N, K = [int(s) for s in input().split(" ")]
res = 0
for i in range(K, N + 2):
  res += (N - i + 1) * i + 1
  
  print(res % 1000000007)

N, K = [int(s) for s in input().split(" ")]
res = 0
for i in range(K, N + 2):
  res += (N - i + 1) * i + 1
  
print(res % 1000000007)


Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
N, K = map(int, input().split())
MOD = 10 ** 9 + 7

LOW, HIGH = 0, N
ans = 0

if K >= 1:
    ans += (HIGH - LOW + 1)

for i in range(2, N + 2):
    LOW += i - 1
    HIGH += N - i + 1
    LOW %= MOD
    HIGH %= MOD
    if i >= K:
        ans += (HIGH - LOW + 1)
        ans %= MOD

print(ans)


N, K = map(int, input().split())
MOD = 10 ** 9 + 7

low, high = 0, 0
ans = 0
for i in range(1, N + 2):
    low += i - 1
    high += N - i + 1

    if i >= K:
        ans += (high - low + 1)
        ans %= MOD

print(ans)


Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
import numpy as np
import functools
import math
import collections
import scipy
import fractions
import itertools

def solve():
    n, k = map(int, input().split())
    small = 0
    large = 0
    ans = 0
    for i in range(0, n+1):
        small += i
        large += n-i
        if i+1 >= k:
            ans = (ans + (large - small + 1)) % mod
    print(ans)
    return 0

if __name__ == "__main__":
    solve()


import numpy as np
import functools
import math
import collections
import scipy
import fractions
import itertools

def solve():
    n, k = map(int, input().split())
    small = 0
    large = 0
    ans = 0
    mod = 10**9+7
    for i in range(0, n+1):
        small += i
        large += n-i
        if i+1 >= k:
            ans = (ans + (large - small + 1)) % mod
    print(ans)
    return 0

if __name__ == "__main__":
    solve()


Verdicts: Runtime Error

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
n,k=map(int,input().split());mod=10**9+7;print((n*(n+1)*(n+2)//6-k*(k-1)*(3*n-2*k+4)//6+n-k+2)%mod

n,k=map(int,input().split());print((n*(n+1)*(n+2)//6-k*(k-1)*(3*n-2*k+4)//6+n-k+2)%(10**9+7))

Verdicts: Runtime Error

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
# D - Sum of Large Numbers
from itertools import accumulate


def main():
    N, K = map(int, input().split())
    MOD = 10 ** 9 + 7
    cumsum_left = tuple(accumulate(range(N + 1)))
    cumsum_right = tuple(accumulate(reversed(range(N + 1))))
    total = sum(r - 1 + 1 for l, r in zip(cumsum_left[K - 1 :], cumsum_right[K - 1 :]))
    total %= MOD
    print(total)


if __name__ == "__main__":
    main()


# D - Sum of Large Numbers
from itertools import accumulate


def main():
    N, K = map(int, input().split())
    MOD = 10 ** 9 + 7
    cumsum_left = tuple(accumulate(range(N + 1)))
    cumsum_right = tuple(accumulate(range(N + 1)[::-1]))
    total = sum(r - l + 1 for l, r in zip(cumsum_left[K - 1 :], cumsum_right[K - 1 :]))
    total %= MOD
    print(total)


if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
N,K = map(int,input().split())
ans = 0
temp_max = N
temp_min = 0
for i in range(K,N+2):
  temp_max += N-i+1
  temp_min += i-1
  ans += temp_max - temp_min + 1
print(ans%(10**9+7)

N,K = map(int,input().split())
ans = 0
temp_max = 0
temp_min = 0
for i in range(1,N+2):
  temp_max += N-i+1
  temp_min += i-1
  if i  >= K:
    ans += (temp_max - temp_min + 1)
print(ans%(10**9+7))

Verdicts: Runtime Error

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
n,k=map(int,input().split())
res=0
for i in range(k,n+2):
  res+=(2*n-i+1)/2*i-(i/2*(i-1))+1
  print(res)
print("{}".format(int(res%(10**9+7))))

n,k=map(int,input().split())
res=0
for i in range(k,n+2):
  res+=(2*n-i+1)/2*i-(i/2*(i-1))+1
  #print(res)
print("{}".format(int(res%(10**9+7))))

Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
if __name__ == "__main__":
    # 1 <= N <= 2 * 10^5
    # 1 <= K <= N + 1
    N, K = map(int, input().split(" "))

    total_num = 0
    for k in range(K, N+2):
        
        sum_max = k*(2*N - k + 1) / 2
        
        sum_min = k*(k-1) / 2
        
        total_num += sum_max - sum_min + 1
        total_num %= 1000000007
    
    print(total_num)

if __name__ == "__main__":
    # 1 <= N <= 2 * 10^5
    # 1 <= K <= N + 1
    N, K = map(int, input().split(" "))

    total_num = 0
    for k in range(K, N+2):
        
        sum_max = k*(2*N - k + 1) / 2
        
        sum_min = k*(k-1) / 2
        
        total_num += sum_max - sum_min + 1
        total_num %= 1000000007
    
    print(total_num)

if __name__ == "__main__":
    # 1 <= N <= 2 * 10^5
    # 1 <= K <= N + 1
    N, K = map(int, input().split(" "))

    total_num = 0
    for k in range(K, N+2):
        
        sum_max = int(k*(2*N - k + 1) / 2)
        
        sum_min = int(k*(k-1) / 2)
        
        total_num += sum_max - sum_min + 1
        total_num %= 1000000007
    
    print(total_num)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
n,m = map(int, input().split())
x = n+1
ans = 0
from itertools import combinations
for i in range(m,n+2):
    ans = ans + len(list(combinations(range(x),i)))
print(ans)

n,m = map(int, input().split())
ans = 0
for i in range(m,n+2):
    ans+=(n-i+1)*i+1
    ans = ans%(10**9+7)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
n, k = map(int, input().split())
ans = 0
for i in range(k, n + 1):
    ans += (n * (n + 1) / 2) - ((n - i) * (n - i + 1) / 2) - (((i - 1) * (i) / 2) - 1)
ans = ans + 1
print(ans)

n, k = map(int, input().split())
back = []
forward = []
a = 0
b = 0
for i in range(n + 1):
    a += i
    b += n - i
    forward.append(a)
    back.append(b)
ans = 0
for i in range(k, n + 1):
    ans += back[n - i] - forward[n - i] + 1
ans = (ans + 1) % (10 ** 9 + 7)
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

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

A = (N - 1) * N * (N + 1) // 2
B = N * (N + 1) * (2 * N + 1) // 6
C = N * K * (K + 1) // 2
D = (K - 1) * K * (K + 1) // 3

Ans = (A - B - C + D) % x

print(Ans)

N, K = map(int, input().split())
x = 100000007
 
A = (N - 1) * N * (N + 1) // 2
B = N * (N + 1) * (2 * N + 1) // 6
C = N * K * (K + 1) // 2
D = (K - 1) * K * (K + 1) // 3
 
Ans = (A - B - C + D) % x
 
print(Ans)

N, K = map(int, input().split())
x = 100000007
 
A = (N - 1) * N * (N + 1) // 2
B = N * (N + 1) * (2 * N + 1) // 6
C = N * K * (K + 1) // 2
D = (K - 1) * K * (K + 1) // 3
E = N - K + 1 
Ans = (A - B - C + D + E) % x
 
print(Ans)

N, K = map(int, input().split())
x = 100000007
 
A = N * (N * (N + 1) - K * (K - 1)) // 2
B = (N * (N + 1) * (2 * N + 1) - K * (K - 1) * (2 * K - 1)) // 6
C = N - K + 1

Ans = (A - B + C) % x
 
print(Ans)

N, K = map(int, input().split())
x = 1000000007
 
A = N * (N * (N + 1) - K * (K - 1)) // 2
B = (N * (N + 1) * (2 * N + 1) - K * (K - 1) * (2 * K - 1)) // 6
C = N - K + 2
D = (N * (N + 1) - K * (K - 1)) // 2

Ans = (A - B + C + D) % x
 
print(Ans)

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
n, k = map(int,input().split())
A = list(range(n+1))
ans = 0
for i in range(k,n+1):
  ans += sum(A[-k:]) - (k-1)*k//2
print(ans)

n, k = map(int,input().split())
MOD = 10**9+7
A = list(range(n+1))
ans = 0
for i in range(k,n+2):
  ans += (n+n-i+1)*i//2 - (i-1)*i//2+1
  
print(ans%MOD)

Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):
n, k = [int(i) for i in input().split()]
mod = 10**9 + 7
ans = 0

for i in range(k, n + 2):
    first = i * (i - 1) / 2
    final = (n * 2 - i + 1) * i / 2
    add = final - first + 1
    ans = (ans + add) % mod

print(ans)


n, k = [int(i) for i in input().split()]
mod = 10**9 + 7
ans = 0

for i in range(k, n + 2):
    first = i * (i - 1) / 2
    final = (n * 2 - i + 1) * i / 2
    add = final - first + 1
    ans = (ans + add) % mod

print(int(ans))


Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

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

print(math.factorial(int(N)+1) / math.factorial(int(K)) - math.factorial(int(K)))

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

ans, saidai, saisyo = 0, 0, 0
for i in range(1, N+2):
    saisyo += i-1
    saidai += N-i+1
    if i >= K:
        ans += (saidai - saisyo + 1)
    
print(ans%(10**9+7))


Verdicts: Runtime Error

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):

N,K=map(int,input().split())
ans=0


for i in range(K,N+1):
    mini=i*(i-1)//2
    maxi=i*(N-1)
    ans=(ans+(mini-maxi+1))//(10^9+7)
print(ans)    

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

M=N+1

A=-M*(M+1)*(2*M+1)//6+(N+1)*M*(M+1)//2+M

M=K-1

B=-M*(M+1)*(2*M+1)//6+(N+1)*M*(M+1)//2+M


print((A-B)%(10**9+7))

Verdicts: Wrong Answer

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

Submission attempts (in order):


import sys
input = sys.stdin.readline
S = input().split()
S=S[0]
Q = int(input())
FQ_dic =tuple()
rev =0
for i in range(Q):
    FQ_dic =tuple(input().split())

    if      FQ_dic[0] =="1": 
                rev +=1
    else:                   
        if      FQ_dic[1]=="1":     
            if rev %2 ==0:
                    S = FQ_dic[2] , S
            else:
                    S = S ,FQ_dic[2] 
        else: 
            if rev %2 ==0:
                    S = S , FQ_dic[2]
            else:        
                    S = FQ_dic[2] , S


def flatten_list_tuple_range(l):
    for el in l:
        if isinstance(el, (list, tuple, range)):
            yield from flatten_list_tuple_range(el)
        else:
            yield el
S =flatten_list_tuple_range(S)
S=[i for i in S]


if rev %2 ==0:
    print(*S,sep="")
else:
    print(*S[::-1],sep="")


import numpy as np 
N,Q = (int(x) for x in input().split())
aa=0  
bb=0
a=[0] 
b=[0]
a_set =set()
ki_kouzou =np.zeros((N+1,1),dtype=np.int32)
ki_kouzou_dic ={i:set() for i in range(1,N+1)}


for i in range(1,N): 
    aa,bb = (int(x) for x in input().split())
    if bb in a_set: 
        #np.append(ki_kouzou[bb,:],aa,axis=1)
        a_set.add(aa)
        ki_kouzou_dic[bb].add(aa)
    else:
        #np.append(ki_kouzou[aa,:],bb,axis=1)
        #ki_kouzou[aa].append(bb)
        ki_kouzou_dic[aa].add(bb)
        a_set.add(bb)
    a.append(aa)     
    b.append(bb)



kansetu ={i:set() for i in range(1,N+1)}
for ki_key in range(1,N+1) :
    for v_v in ki_kouzou_dic[ki_key]:
        if v_v in ki_kouzou_dic.keys():
            kansetu[ki_key] = kansetu[ki_key] | ki_kouzou_dic[v_v] 

for i in range(1,N+1):
    ki_kouzou_dic[i] =ki_kouzou_dic[i] | kansetu[i] 
    ki_kouzou_dic[i].add(i) 



point={i:0 for i in range(1,N+1)}
pp=0 ; xx=0
for _ in range(Q):
    pp,xx = (int(x) for x in input().split())
    for i in ki_kouzou_dic[pp]:
        point[i] += xx 

print(*point.values())


NN,K = (int(x) for x in input().split())


p =10**9 + 7
seq =[i for i in range(NN+1)] 
ans =[0] *(NN+1)
st =[0]*(NN+1)
fi =[0]*(NN+1)
st[0] =sum(seq[  :K])
fi[0] =sum(seq[-K: ])
ans[0] =fi[0] -st[0] +1
if NN==1 and K==1:
    print(3)
else:
    for i in range(NN -K+1):
        st[i+1] =st[i] +seq[K+i]
        fi[i+1] =fi[i] +seq[-K-i-1]
        ans[i+1] =(fi[i+1] -st[i+1] +1)
    print(sum(ans) %p)

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: We have N+1 integers: 10^{100}, 10^{100}+1, ..., 10^{100}+N.  We will choose K or more of these integers. Find the number of possible values of the sum of the chosen numbers, modulo (10^9+7).

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

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

mod = 10**9+7
fact = [1, 1]
factinv = [0, 1]
inv = [0, 1]
total = 0

for i in range(2, N+1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod // i)) % mod)
    factinv.append((factinv[-1] * inv[-1]) % mod)

for i in range(K, N+1):
    total += combination_mod(N, i, mod) % mod

print(total)


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

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

mod = 10**9+7
fact = [1, 1]
factinv = [0, 1]
inv = [0, 1]
total = 0

for i in range(2, N+1):
    fact.append((fact[-1] * i) % mod)
    inv.append((-inv[mod % i] * (mod // i)) % mod)
    factinv.append((factinv[-1] * inv[-1]) % mod)

for i in range(K, N+1):
    total += combination_mod(N, i, mod) % mod

print(total)


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

total = 0
mod = 10**9+7
s = [0]
for i in range(0, N+1):
    s.append(s[-1] + i)

for i in range(K, N+2):
    total = (total + ((s[-1]-s[-(i+1)]) - s[i] + 1)) % mod
print(total)

Verdicts: Runtime Error

Wrong Answer

Accepted