ZhenlongDai/ACPR huggingface dataset:
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B=map(int,input().split())
if (B-A)%2==0:
  print(int((B-A)/2))
elif (B-1)>=(N-A):
  print(N-A)
else:
  print(B-1)

Failing test case input:
6 -1 36

Expected output:
-11


Actual output:
7


Fixed submission (verdict: Accepted):
N,A,B=map(int,input().split())
if (B-A)%2==0:
  print((B-A)
elif (B-1)>=(N-A):
  
  
  
  print(((B-A-1)
else:
  
  
  
  print(((B-A-1)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = [int(i) for i in input().split()]
if (b-a)%2==0:
    print(int( (b-a)/2 ))
else:
    r = int( a + (b-a-1)/2 +0.5)
    l = int( n-b+1 + ( n - (a+n-b+1) )/2 +0.5)
    print(min(r,l))

Failing test case input:
1 3 38

Expected output:
-19


Actual output:
-18


Fixed submission (verdict: Accepted):
n,a,b = [int(i) for i in input().split()]
if (b-a)%2==0:
    print((b-a)
else:
    r = a + (b-a-1)
    l = n-b+1 + ( n - (a+n-b+1) )
    print(min(r,l))

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
inputLine = input().split(' ')
N = int(inputLine[0])
A = int(inputLine[1])
B = int(inputLine[2])

if abs(A - B) % 2 == 1:
  print(int(min((max(A, B) - 1), (N - (min(A, B))))))
else:
  print(int(abs(A - B) / 2))


Failing test case input:
0 1 24

Expected output:
-12


Actual output:
-1


Fixed submission (verdict: Accepted):
inputLine = input().split(' ')
N = int(inputLine[0])
A = int(inputLine[1])
B = int(inputLine[2])

if (B - A) % 2 == 1:
  returnNum = int(min((N - B), (A - 1)))
  print(int(returnNum + 1 + (B - A - 1) 
else:
  print(int((B - A)

Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n, a, b = map(int, input().split())
ans = 0

if (b-a)%2 == 0:
    ans = (b-a) 
else:
    ans = min(n-a, b-1)
    
print(ans)

Failing test case input:
0 5 249

Expected output:
122


Actual output:
244


Fixed submission (verdict: Accepted):
n, a, b = map(int, input().split())
ans = 0

if (b-a)%2 == 0:
    ans = (b-a) 
else:
    ans = min((2*n-a-b+1)
    
print(ans)

Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,a,b = list(map(int, input().split()))
sa = b-a
if sa%2==0:
  print(int(sa/2))
else:
  print(int(sa/2)+1+min(b-1,n-a))

Failing test case input:
1 3 8

Expected output:
-4


Actual output:
1


Fixed submission (verdict: Accepted):
n,a,b = list(map(int, input().split()))
if (b-a)%2==0:
  print(int((b-a)
else:
  print(min(a-1,n-b) + 1 + int((b-a-1)

Problem: p02823
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N, A, B = map(int, input().split())
if A % 2 == B % 2: 
    print(abs(int((A-B)/2)))
else: 
    print(min(max(A-1, B-1), max(N-A, N-B)))

Failing test case input:
-2 5 38

Expected output:
-23


Actual output:
-7


Fixed submission (verdict: Accepted):
N, A, B = map(int, input().split())
if A % 2 == B % 2: 
    print((B - A) 
else: 
    
    print(min(A, (N - B + 1)) + ((B - A - 1)
Problem: p02823
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,A,B = map(int, input().split())
if A-B%2 ==0:
  print(A/B/2)
else:
  print(min(A-1,N-B)+1+(B-A-1)/2)


Failing test case input:
4 -2 62

Expected output:
32


Actual output:
-25.5


Fixed submission (verdict: Accepted):
N,A,B = map(int, input().split())
if (B-A)%2==0:
  print((B-A)
else:
  print(min(A-1,N-B)+1+(B-A-1)
Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def read():
    h = int(input())
    w = int(input())
    n = int(input())
    return h, w, n


def calc(h, w, n):
    if h > w:
        return int(n / h) + 1
    else:
        return int(n / w) + 1


def main():
    print(calc(*read()))


if __name__ == "__main__":
    main()



Failing test case input:
2
000
4

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):

def read():
    h = int(input())
    w = int(input())
    n = int(input())
    return h, w, n


def calc(h, w, n):
    if h > w:
        w = h
    
    if n % w  == 0:
        return int(n / w)
    else:
        return int(n/w)+1


def main():
    print(calc(*read()))


if __name__ == "__main__":
    main()

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())

i = 0
j = 0
if H > W:
    while i < N:
        j = j + 1
        i = (H * j) + i
elif H < W:
    while i < N:
        j = j + 1
        i = (W * j) + i
else:
    while i < N:
        j = j + 1
        i = (H * j) + i
print(j)


Failing test case input:
14
1
248

Expected output:
18


Actual output:
6


Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())

i = 0
j = 0
if H > W:
    while i < N:
        j = j + 1
        i = H + i
elif H < W:
    while i < N:
        j = j + 1
        i = W + i
else:
    while i < N:
        j = j + 1
        i = H + i
print(j)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=int(N/W)+1
else:
    if N%H==0:
        k=N/H
    else:
        k=int(N/H)+1


print(k)

Failing test case input:
3
0
81

Expected output:
27


Actual output:
27.0


Fixed submission (verdict: Accepted):
import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
else:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)

k=int(k)
print(k)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h=int(input())
w=int(input())
n=int(input())
x = n/(h if w <= h else w)
print(x if int(x) == x else int(x)+1)

Failing test case input:
2
000
26

Expected output:
13


Actual output:
13.0


Fixed submission (verdict: Accepted):
h=int(input())
w=int(input())
n=int(input())
x = int(n/(h if w <= h else w))
y = n%(h if w <= h else w)
print(x if y == 0 else x+1)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h=int(input())
w=int(input())
n=int(input())
a=max(h,w)
b=0
m=0

while b+a<=n:
	b+=a
	m+=1
print(m)

Failing test case input:
14
2
1738

Expected output:
125


Actual output:
124


Fixed submission (verdict: Accepted):
h=int(input())
w=int(input())
n=int(input())
a=max(h,w)
b=0
m=0

if n%a==0:
  print(n
else:
  print(n
Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h=int(input())
w=int(input())
n=int(input())
b=max(h,w)
print(b)
num=0
a=0
while a<n:
	num+=1
	a+=b
print(num)

Failing test case input:
14
2
1222

Expected output:
88


Actual output:
14
88


Fixed submission (verdict: Accepted):
h=int(input())
w=int(input())
n=int(input())
b=max(h,w)
num=0
a=0
while a<n:
	num+=1
	a+=b
print(num)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
print(int(n / max(h,w)))

Failing test case input:
14
10
342

Expected output:
25


Actual output:
24


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
m = max(h, w)
if n % m:
  print(n 
else:
  print(n

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h=int(input())
w=int(input())
n=int(input())

s=max(h,w)
a=n
print(a)

Failing test case input:
3
7
43

Expected output:
7


Actual output:
43


Fixed submission (verdict: Accepted):
h=int(input())
w=int(input())
n=int(input())

import math

s=max(h,w)
a=math.ceil(n/s)
print(a)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
if h*w == n:
  print(h)
else:
 while b <= n:
   b += a
   count += 1
 print(count)

Failing test case input:
14
0
956

Expected output:
69


Actual output:
68


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
if h*w == n:
  print(h)
elif b >= n:
  print(1)
else:
 while b*count < n:
   count += 1
 print(count)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h=int(input())
w=int(input())
n=int(input())
ans=n/(max(h,w))
print(int(ans))

Failing test case input:
14
2
28787

Expected output:
2057


Actual output:
2056


Fixed submission (verdict: Accepted):
import math
h=int(input())
w=int(input())
n=int(input())
ans=math.ceil(n/(max(h,w)))
print(int(ans))

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())

print(int(N/max(H,W))+1)

Failing test case input:
2
000
200

Expected output:
100


Actual output:
101


Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())

print(int((N+max(H,W)-1)/max(H,W)))

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())

large = max(H,W)

ans = int(N / large)+1

print(ans)

Failing test case input:
2
000
308

Expected output:
154


Actual output:
155


Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())

large = max(H,W)
ans = int((N-1) / large)+1

print(ans)
Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())

if h < w:
    if n % w == 0:
        print(n % w)
    else:
        print(n % w + 1)
else:
    if n % h == 0: 
        print(n % h)
    else:
        print(n % h + 1)

Failing test case input:
3
1
46

Expected output:
16


Actual output:
2


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())

if h < w:
    if n % w == 0:
        print(n 
    else:
        print(n 
else:
    if n % h == 0: 
        print(n 
    else:
        print(n

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
else:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)


print(k)

Failing test case input:
2
000
42

Expected output:
21


Actual output:
21.0


Fixed submission (verdict: Accepted):
import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
else:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)

k=int(k)
print(k)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
while b <= n:
  b += a
  count += 1
print(count)

Failing test case input:
3
5
81

Expected output:
17


Actual output:
16


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
if h*w == n:
  print(h)
elif b >= n:
  print(1)
else:
 while b*count < n:
   count += 1
 print(count)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b,c=[int(input()) for i in range(3)]
def main(a,b,c):
    x=max([a,b])
    return int(c/x)+1
main(a,b,c)


Failing test case input:
14
2
28787

Expected output:
2057


Actual output:

Fixed submission (verdict: Accepted):
a,b,c=[int(input()) for i in range(3)]
def main(a,b,c):
    x=max([a,b])
    if c%x==0:
      print(int(c/x))
    else:
      print(int(c/x+1))
main(a,b,c)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
if(h>=w):
    big=h
else:
    big=w
print(int(n/big))

Failing test case input:
14
1
20917

Expected output:
1495


Actual output:
1494


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
import math

if(h>=w):
    big=h
else:
    big=w
print(math.ceil(n/big))

Problem: p02795
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = int(input())
b = int(input())
n = int(input())
t = max(a, b)
print(n + t - 1 / t)

Failing test case input:
14
10
342

Expected output:
25


Actual output:
355.92857142857144


Fixed submission (verdict: Accepted):
a = int(input())
b = int(input())
n = int(input())
t = max(a, b)
print((n + t - 1)
Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())

if h>w:
	nBig = h
else:
    nBig = w
    
ans = int(n/nBig)+1

print(ans)

Failing test case input:
2
000
406

Expected output:
203


Actual output:
204


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())

if h>w:
	nBig = h
else:
    nBig = w
    
if n%nBig == 0:
	ans = int(n/nBig)
else:
    ans = int(n/nBig)+1

print(ans)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

h = int(input())
w = int(input())
n = int(input())

print(math.floor(n / max(h, w)) + 1)

Failing test case input:
2
000
308

Expected output:
154


Actual output:
155


Fixed submission (verdict: Accepted):
import math

h = int(input())
w = int(input())
n = int(input())

print(math.ceil(n / max(h, w)))

Problem: p02795
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def solve(H, W, N):
    c = 0
    b = 0
    L = max(H, W)
    while b < N:
        b += L
        c += 1
    return c
H = int(input())
W = int(input())
N = int(input())

        

Failing test case input:
2
000
26

Expected output:
13


Actual output:

Fixed submission (verdict: Accepted):
def solve(H, W, N):
    c = 0
    b = 0
    L = max(H, W)
    while b < N:
        b += L
        c += 1
    return c
H = int(input())
W = int(input())
N = int(input())
print(solve(H, W, N))

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
H = int(sys.stdin.readline())
W = int(sys.stdin.readline())
N = int(sys.stdin.readline())

print((N - 1) / max(H, W) + 1)

Failing test case input:
14
12
112

Expected output:
8

Actual output:
8.928571428571429


Fixed submission (verdict: Accepted):
import sys
H = int(sys.stdin.readline())
W = int(sys.stdin.readline())
N = int(sys.stdin.readline())
 
print((N - 1)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())

print((N+max(H,W)-1)/max(H,W))


Failing test case input:
14
0
9760

Expected output:
698


Actual output:
698.0714285714286


Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())

print(int((N+max(H,W)-1)/max(H,W)))

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.floor(N/W)+1
else:
    if N%H==0:
        k=N/H
    else:
        k=math.floor(N/H)+1


print(k)

Failing test case input:
3
2
90

Expected output:
30


Actual output:
30.0


Fixed submission (verdict: Accepted):
import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
else:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)

k=int(k)
print(k)
Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h=int(input())
w=int(input())
n=int(input())
ans=0
x=max(h,w)
while n>0:
    ans+=1
    n=n-ans*x
print(ans)

Failing test case input:
14
1
3114

Expected output:
223


Actual output:
21


Fixed submission (verdict: Accepted):

h=int(input())
w=int(input())
n=int(input())
ans=0
x=max(h,w)
while n>0:
    ans+=1
    n=n-x
print(ans)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())

i = 0
j = 1

if H > W:
    while i < N:
        i = (H * j) + i
        j = j + 1
elif H < W:
    while i < N:
        i = (W * j) + i
        j = j + 1
else:
    while i < N:
        i = (H * j) + i
        j = j + 1
print(j-1)


Failing test case input:
14
2
1152

Expected output:
83


Actual output:
13


Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())

i = 0
j = 0
if H > W:
    while i < N:
        j = j + 1
        i = H + i
elif H < W:
    while i < N:
        j = j + 1
        i = W + i
else:
    while i < N:
        j = j + 1
        i = H + i
print(j)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
if h < w:
    h = w
print(int(n / h) + 1)

Failing test case input:
14
0
1764

Expected output:
126


Actual output:
127


Fixed submission (verdict: Accepted):
import math
h = int(input())
w = int(input())
n = int(input())
if h < w:
    h = w
print(math.ceil(n / h))

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = [int(input()) for i in range(2)]
b = int(input())
c = b 
print(c)

Failing test case input:
14
0
16704

Expected output:
1194


Actual output:
16704


Fixed submission (verdict: Accepted):
a = [int(input()) for i in range(2)]
b = int(input())
if b % max(a) == 0:
  print(b 
else:
  print(b

Problem: p02795
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())
A = max(H,W)
print((N-1)%A+1)

Failing test case input:
3
1
34

Expected output:
12


Actual output:
1


Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())
A = max(H,W)
print((N-1)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())

if H >= W:
    if N%H == 0:
        count = N/H
    else:
        count = int(N/H) + 1
else:
    if N%H == 0:
        count = N/W
    else:
        count = int(N/W) + 1
print(int(count))



Failing test case input:
3
7
15

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())

if H >= W:
    if N%H == 0:
        count = N/H
    else:
        count = int(N/H) + 1
else:
    if N%W == 0:
        count = N/W
    else:
        count = int(N/W) + 1
print(int(count))
Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())

if h>w:
	nBig = h
else:
    nBig = w
    
ans = int(n/nBig)

print(ans)

Failing test case input:
2
000
227

Expected output:
114


Actual output:
113


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())

if h>w:
	nBig = h
else:
    nBig = w
    
if n%nBig == 0:
	ans = int(n/nBig)
else:
    ans = int(n/nBig)+1

print(ans)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
print(n % max(h,w))

Failing test case input:
14
0
14497

Expected output:
1036


Actual output:
7


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
if n % max(h,w) == 0:
  print(n 
else:
  print(n

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
if h*w == n:
  print(h)
elif b >= a:
  print(1)
else:
 while b <= n:
   b += a
   count += 1
 print(count)

Failing test case input:
3
1
34

Expected output:
12


Actual output:
1


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
if h*w == n:
  print(h)
elif b >= n:
  print(1)
else:
 while b*count < n:
   count += 1
 print(count)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
t = 0

print(max(h,w))

Failing test case input:
14
1
2371

Expected output:
170


Actual output:
14


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())

print(int((n-1) / max(h,w))+1)

Problem: p02795
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
cnt = 0
ans = 0
max_num = 0
while ans < n:
    if h < w:
        ans += w
        w -= 1
    else:
        ans += h
        w -= 1
    cnt += 1
print(cnt)

Failing test case input:
3
7
43

Expected output:
7


Actual output:
11


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
cnt = 0
ans = 0
while ans < n:
    if h < w:
        ans += w
        h -= 1
    else:
        ans += h
        w -= 1
    cnt += 1
print(cnt)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())

a = max(H,W)

x = int(N/a)
print(x)

Failing test case input:
3
7
54

Expected output:
8


Actual output:
7


Fixed submission (verdict: Accepted):
import math
H = int(input())
W = int(input())
N = int(input())

a = max(H,W)

x = math.ceil(N/a)
print(x)
Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
if H>=W:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)


print(k)

Failing test case input:
14
1
1050

Expected output:
75


Actual output:
75.0


Fixed submission (verdict: Accepted):
import math

H=int(input())
W=int(input())
N=int(input())

if W>H :
    if N%W==0:
        k=N/W
    else:
        k=math.ceil(N/W)
else:
    if N%H==0:
        k=N/H
    else:
        k=math.ceil(N/H)

k=int(k)
print(k)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())
for i in range(100):
    if max(H, W) * i >= N:
        print(i)
        exit()

Failing test case input:
2
000
217

Expected output:
109


Actual output:

Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())
for i in range(1000000):
    if max(H, W) * i >= N:
        print(i)
        exit()

Problem: p02795
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
h = int(input())
w = int(input())
n = int(input())
h = max(h,w)
print(math.ceil(h/n))

Failing test case input:
14
2
1222

Expected output:
88


Actual output:
1


Fixed submission (verdict: Accepted):
import math
h = int(input())
w = int(input())
n = int(input())
h = max(h,w)
print(math.ceil(n/h))

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
count = 0
if(h >= w):
    while(n > h):
        n -= h
        count += 1
    print(count)
else:
    while(n > w):
        n -= w
        count += 1
    print(count)


Failing test case input:
14
1
1118

Expected output:
80


Actual output:
79


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
ha = h
wa = w
count = 1
if(h >= w):
    while(n > ha):
        ha += h
        count += 1
    print(count)
else:
    while(n > wa):
        wa += w
        count += 1
    print(count)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
count = 1
if(h >= w):
    while(n > h):
        h += h
        count += 1
    print(count)
else:
    while(n > w):
        w += w
        count += 1
    print(count)


Failing test case input:
14
22
1688

Expected output:
77


Actual output:
8


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
ha = h
wa = w
count = 1
if(h >= w):
    while(n > ha):
        ha += h
        count += 1
    print(count)
else:
    while(n > wa):
        wa += w
        count += 1
    print(count)
Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
if h*w == n:
  print(h)
elif b >= n:
  print(1)
else:
 while b <= n:
   b += a
   count += 1
 print(count)

Failing test case input:
3
1
151

Expected output:
51


Actual output:
50


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
a = max(h,w)
b = a
count = 0
if h*w == n:
  print(h)
elif b >= n:
  print(1)
else:
 while b*count < n:
   count += 1
 print(count)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H = int(input())
W = int(input())
N = int(input())

sum = 0
if H > W :
  sum = int(N / H) + ( 0 if N%H == 0 else 1)
else:
  sum = int(N / W) + ( 0 if N%H == 0 else 1)
  
print(sum)

Failing test case input:
3
7
54

Expected output:
8


Actual output:
7


Fixed submission (verdict: Accepted):
H = int(input())
W = int(input())
N = int(input())

sum = 0
if H > W :
  sum = int(N / H) + ( 0 if N%H == 0 else 1)
else:
  sum = int(N / W) + ( 0 if N%W == 0 else 1)
  
print(sum)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())

if h>w:
	nBig = h
else:
    nBig = w
    
    
    
print(n,nBig)
ans = int(n/nBig)+1

print(ans)

Failing test case input:
2
000
42

Expected output:
21


Actual output:
42 2
22


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())

if h>w:
	nBig = h
else:
    nBig = w
    
if n%nBig == 0:
	ans = int(n/nBig)
else:
    ans = int(n/nBig)+1

print(ans)

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
if h < w:
  t = n / w
else:
  t = n / h
print(int(t))

Failing test case input:
14
8
1729

Expected output:
124


Actual output:
123


Fixed submission (verdict: Accepted):
import math

h = int(input())
w = int(input())
n = int(input())
if h < w:
  t = n / w
else:
  t = n / h
print(math.ceil(t))

Problem: p02795
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
h = int(input())
w = int(input())
n = int(input())
count = 0
if(h >= w):
    while(n > h):
        h += h
        count += 1
    print(count)
else:
    while(n > w):
        w += w
        count += 1
    print(count)


Failing test case input:
3
2
59

Expected output:
20


Actual output:
5


Fixed submission (verdict: Accepted):
h = int(input())
w = int(input())
n = int(input())
ha = h
wa = w
count = 1
if(h >= w):
    while(n > ha):
        ha += h
        count += 1
    print(count)
else:
    while(n > wa):
        wa += w
        count += 1
    print(count)

Problem: p02795
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
H=int(input())
W=int(input())
N=int(input())
k=max(H, W)
cnt=0
while k*cnt<=N:
    cnt+=1
print(cnt)

Failing test case input:
2
000
12

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
H=int(input())
W=int(input())
N=int(input())
k=max(H, W)
cnt=0
while k*cnt<N:
    cnt+=1
print(cnt)
Problem: p03976
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def inpl(): return list(map(int, input().split()))

N, K = inpl()
S = [0]*26
for _ in range(N):
    S[ord(input()[0]) - 65] += 1

ans = 0
while True:
    S = sorted(S, reverse=True)
    s = S[K-1]
    if s == 0:
        break
    ans += s
    for i in range(K):
        S[i] -= s
print(ans)

Failing test case input:
9 3
ELPPA
ANT
ATCODER
BLOCK
BULK
OSSB
CAT
COF
EGG

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
def inpl(): return list(map(int, input().split()))

N, K = inpl()
S = [0]*26
for _ in range(N):
    S[ord(input()[0]) - 65] += 1

ans = 0
while True:
    S = sorted(S, reverse=True)
    s = S[K-1]
    if s == 0:
        break
    ans += 1
    for i in range(K):
        S[i] -= 1
print(ans)

Problem: p03976
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,k = map(int,input().split())
p = [input() for _ in range(n)]
p_ini = [0]*26
for _p in p:
    p_ini[ord(_p[0])-ord('A')] += 1
res = 0
while p_ini.count(0)<=26-k:
    tmp = 0
    for i in range(26):
        if p_ini[i]!=0:
            p_ini[i] -= 1
            tmp += 1
        if tmp==k:
            break
    res += 1
print(res)


Failing test case input:
9 3
ELPPA
ANT
ATCODER
BLOCK
BULK
OSSB
CAT
COF
EGG

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
p = [input() for _ in range(n)]
p_ini = [0]*26
for _p in p:
    p_ini[ord(_p[0])-ord('A')] += 1
res = 0
while p_ini.count(0)<=26-k:
    p_ini = sorted(p_ini)[::-1]
    for i in range(k):
        if p_ini[i]!=0:
            p_ini[i] -= 1
    res += 1
print(res)

Problem: p03976
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k = map(int,input().split())
p = [input()[0] for i in range(n)]
from collections import Counter
c = Counter(p)
v = sorted(list(c.values()),reverse=True)
ans = 0
while len(v)>=k:
    for i in range(k):
        v[i] -= 1
        if v[i]<0:
            print(ans)
            exit()
    ans += 1
    v = sorted(v,reverse=True)

Failing test case input:
3 4
UK
IADVOYK
VINTOTOYK

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
p = [input()[0] for i in range(n)]
from collections import Counter
c = Counter(p)
v = sorted(list(c.values()),reverse=True)
ans = 0
while len(v)>=k:
    for i in range(k):
        v[i] -= 1
        if v[i]<0:
            print(ans)
            exit()
    ans += 1
    v = sorted(v,reverse=True)
print(ans)
Problem: p03976
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k = map(int,input().split())
p = [input()[0] for i in range(n)]
from collections import Counter
c = Counter(p)
v = list(c.values())
ans = 0
while len(v)>=k:
    c = 0
    while c<k and len(v)>=k:
        if v[c]==0:
            v.pop(c)
        else:
            v[c] -= 1
            c+=1
    if c==k:ans += 1
print(ans)

Failing test case input:
9 3
ELQPA
UNB
ATCODER
LCOLB
KLUB
OSSB
TAC
GOC
GGE

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
p = [input()[0] for i in range(n)]
from collections import Counter
c = Counter(p)
v = sorted(list(c.values()),reverse=True)
ans = 0
while len(v)>=k:
    for i in range(k):
        v[i] -= 1
        if v[i]<0:
            print(ans)
            exit()
    ans += 1
    v = sorted(v,reverse=True)
print(ans)

Problem: p03976
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k = map(int,input().split())
p = [input()[0] for i in range(n)]
from collections import Counter
c = Counter(p)
v = list(c.values())
ans = 0
while len(v)>=k:
    ans += 1
    c = 0
    i=0
    while c<k and len(v)>=k:
        v[i] -= 1
        if v[c]==0:v.pop(c)
        else:i+=1
        c+=1
print(ans)

Failing test case input:
9 3
ELQPA
UNB
ATCODER
LCOLB
KLUB
OSSB
TAC
GOC
GGE

Expected output:
3


Actual output:
7


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
p = [input()[0] for i in range(n)]
from collections import Counter
c = Counter(p)
v = sorted(list(c.values()),reverse=True)
ans = 0
while len(v)>=k:
    for i in range(k):
        v[i] -= 1
        if v[i]<0:
            print(ans)
            exit()
    ans += 1
    v = sorted(v,reverse=True)
print(ans)

Problem: p03976
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k = map(int,input().split())
p = [input()[0] for i in range(n)]
from collections import Counter
c = Counter(p)
v = list(c.values())
ans = 0
while len(v)>=k:
    ans += 1
    c = 0
    while c<k and len(v)>=k:
        v[c] -= 1
        if v[c]==0:v.pop(c)
        c+=1
print(ans)

Failing test case input:
9 3
APPLE
ANT
ATCODER
BLOCK
BULK
OSSB
CAT
COF
EGG

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
p = [input()[0] for i in range(n)]
from collections import Counter
c = Counter(p)
v = sorted(list(c.values()),reverse=True)
ans = 0
while len(v)>=k:
    for i in range(k):
        v[i] -= 1
        if v[i]<0:
            print(ans)
            exit()
    ans += 1
    v = sorted(v,reverse=True)
print(ans)
Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
sum=0
for i in range(k,n+2):
  sum=sum+i*(n-i+1)+1
print(sum)

Failing test case input:
223214 200001

Expected output:
534704743


Actual output:
55976535096575


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
sum=0
for i in range(k,n+2):
  sum=sum+i*(n-i+1)+1
print(sum%(10**9+7))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
ans = 0
for i in range(K, N+2):
    ans += int((N)*(N+1)/2 - (N-i)*(N-i+1)/2 - (i-1)*i/2 + 1)

print(ans)

Failing test case input:
141421 79028

Expected output:
333950782


Actual output:
194314335310980


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
ans = 0
for i in range(K, N+2):
    ans += int((N)*(N+1)/2 - (N-i)*(N-i+1)/2 - (i-1)*i/2 + 1)

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

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
ans = 0
for i in range(K, N+2):
    ans += i * (N-i+1) + 1
print(ans)

Failing test case input:
4850 976

Expected output:
27110257


Actual output:
17027110376


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
ans = 0
for i in range(K, N+2):
    ans += i * (N-i+1) + 1
print(ans%(10**9+7))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):



line= list(map(int,input().split()))
N = line[0]
K = line[1]


answer = 0
for i in range (K,N+2):
    minit = i*(i-1)/2
    maximum = (2*N-i+1)*i/2
    
    num = maximum-minit+1
    answer += num
    
print(int(answer))
    

Failing test case input:
4850 976

Expected output:
27110257


Actual output:
17027110376


Fixed submission (verdict: Accepted):



line= list(map(int,input().split()))
N = line[0]
K = line[1]


answer = 0
for i in range (K,N+2):
    minit = i*(i-1)/2
    maximum = (2*N-i+1)*i/2
    
    num = maximum-minit+1
    answer += num

if answer >(10**9+7):
    print(int(answer%(10**9+7)))
    
else:
    print(int(answer))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
mod=10**9+7
def f(n):
  return n*(n-1)
ans=0
for i in range(k,n+2):
  a=f(n+1)-f(n-k-i)-f(k+i)+1
  ans+=a%mod
print(ans%mod)

Failing test case input:
1011 23

Expected output:
172487535


Actual output:
343810830


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
mod=10**9+7
def f(n):
  mod=10**9+7
  return (n*(n+1)
ans=0
for i in range(k,n+2):
  a=f(n)-f(n-i)-f(i-1)+1
  ans+=(a%mod)
print(ans%mod)
Problem: p02708
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,K = list(map(int,input().split()))
import math
ans = 0
for i in range(K,N+2):
    if i == 1:
        ans += N + 1
    if i == 2:
        ans += 2*N - 1
    else:
        ans += N*i - i*(i-1) + 1
print(ans % (10**9 + 7))

Failing test case input:
1101 1

Expected output:
223046453


Actual output:
223047555


Fixed submission (verdict: Accepted):
N,K = list(map(int,input().split()))
ans = 0
for i in range(K,N+2):
    if i == 1:
        ans += N + 1
    elif i == 2:
        ans += 2*N - 1
    else:
        ans += N*i - i*(i-1) + 1
print(ans % (10**9 + 7))

Problem: p02708
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,k=map(int,input().split())
cc=0
for i in range(k,n+2):
  cc+=n*i-2*int(i*(i-1)/2)+1
print(cc)
  




Failing test case input:
10163 4398

Expected output:
72432465


Actual output:
105072433200


Fixed submission (verdict: Accepted):
po=pow(10,9)+7
n,k=map(int,input().split())
cc=0
for i in range(k,n+2):
  cc+=(n*i-i*(i-1)+1)%po
print(cc%po)

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K = map(int,input().split())
a =0
for i in range(K,N+2):
    a = a + ((N+N-i+1)*i/2-(i-1)*(i)/2+1)
print(a)

Failing test case input:
1000 2

Expected output:
167167000


Actual output:
167167000.0


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
a =0
for i in range(K,N+2):
    a = a + ((N+N-i+1)*i/2-(i-1)*(i)/2+1)
print(int(a % (10**9+7)))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K=map(int,input().split())
r=0
md=10*9+7
for k in range(K,N+2):
  r += k*(N-k+1)+1  
print(r%md)


Failing test case input:
1100 692

Expected output:
69424070


Actual output:
6


Fixed submission (verdict: Accepted):
N,K=map(int,input().split())
r=0
md=10**9+7
for k in range(K,N+2):
  r += k*(N-k+1)+1  
print(r%md)

Problem: p02708
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,K = map(int,input().split())
ans = 0
for k in range(K,N+1):
    ans += N*k-((k*(k-1))/2)-k+2
print(ans)

Failing test case input:
1000 692

Expected output:
38060870


Actual output:
149476484.0


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
ans = 0
for k in range(K,N+2):
    ans += N*k-k*(k-1)/2-k*(k-1)/2+1
ans %= 10**9+7
print(int(ans))

Problem: p02708
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,k = map(int,input().split())
a = list(range(n+1))
b = a[::-1]
ans = 0

min = sum(a[:k-1])
max = sum(b[:k-1])

for i in range(k,n+2):
    min += a[i-1]
    max += b[i-1]
    ele = max - min +1
    ans += ele

print(ans)

Failing test case input:
141421 79028

Expected output:
333950782


Actual output:
194314335310980


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
a = list(range(n+1))
b = a[::-1]
ans = 0

min = sum(a[:k-1])
max = sum(b[:k-1])


for i in range(k,n+2):
    min += a[i-1]
    max += b[i-1]
    ele = max - min +1
    ans += ele

M =10**9 + 7
print(ans % M)
Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int, input().split())
mod = pow(10,9) + 7

def cal(a,i):
  min = i*(i+1)/2
  max = a*(a+1)/2 - (a-i)*(a-i+1)/2
  return max - min + 1

count = 0
for i in range(a-b+1):
  count += cal(a,i+b)
print(count % mod)

Failing test case input:
3981 131

Expected output:
490150888


Actual output:
482233231.0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
mod = pow(10,9) + 7

def cal(a,i):
  min = i*(i-1)/2
  max = a*(a-1)/2 - (a-i)*(a-i-1)/2
  return max - min + 1

count = 0
for i in range(a-b+2):
  count += cal(a+1,i+b)
print(int(count % mod))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())
mod = 10 ** 9 + 7
ans = 0
tmp = 0
for i in range(K-1):
  tmp += i
for i in range(K, N + 1):
  tmp += K - 1
  ans += K * N - tmp * 2 + 1
  ans = ans % mod
print(ans)
  

Failing test case input:
1010 31

Expected output:
171767541


Actual output:
990780


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())
mod = 10 ** 9 + 7
ans = 0
tmp = 0
for i in range(K-1):
  tmp += i
for i in range(K, N + 2):
  tmp += i - 1
  ans += i * N - tmp * 2 + 1
  ans = ans % mod
print(ans)

Problem: p02708
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n,k=map(int,input().split())
ans=0
for i in range(k,n+2):
    ans+=(i*(n+n-i+1)- i*(i-1))/2+1
print(int(ans))

Failing test case input:
141421 79028

Expected output:
333950782


Actual output:
194314335310980


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
ans=0
for i in range(k,n+2):
    ans+=1+(i*(n+n-i+1)- i*(i-1))/2
if ans>10**9+7: ans%=10**9+7
print(int(ans))

Problem: p02708
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n, k = map(int, input().split())
def sum2(nums):
    res = 0
    for num in nums:
        res += num
        res %= 1000000007
    return res
sum2(1 + l * (n + 1 - l) for l in range(k, n + 2))

Failing test case input:
1010 770

Expected output:
24787092


Actual output:

Fixed submission (verdict: Accepted):
n, k = map(int, input().split())
def sum2(nums):
    res = 0
    for num in nums:
        res += num
        res %= 1000000007
    return res
print(sum2(1 + l * (n + 1 - l) for l in range(k, n + 2)))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K = map(int,input().split())
Mod = 10**9+7

ans = 0

for i in range(K,N+2):
  Min = i*(i-1)/2
  Max = i*(2*N-i+1)/2
  ans += Max-Min+1
print(ans%Mod)


Failing test case input:
1101 598

Expected output:
97439245


Actual output:
97439245.0


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
Mod = 10**9+7

ans = 0

for i in range(K,N+2):
  Min = i*(i-1)/2
  Max = i*(2*N-i+1)/2
  ans += Max-Min+1
print(int(ans%Mod))
Problem: p02708
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N,K = map(int,input().split())
l=list(range(K,N+2))
sum =0
for i in l:
    m=(i-1)*i/2
    p=i*N-2*m+1
    sum+=p
print(int(sum))

Failing test case input:
3981 976

Expected output:
938108982


Actual output:
8938109038


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
l=list(range(K,N+2))
sum =0
for i in l:
    m=(i-1)*i/2
    p=i*N-2*m+1
    sum+=p

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

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
MOD = 10**9+7

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


cnt = 0
for k in range(K,N+2):

    t = (N-k+1)*k
    cnt += t
    cnt %= MOD
print(cnt)

Failing test case input:
1100 573

Expected output:
104556321


Actual output:
104555792


Fixed submission (verdict: Accepted):
MOD = 10**9+7

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

cnt = 0
for k in range(K,N+2):

    t = (N-k+1)*k+1
    cnt += t
    cnt %= MOD
print(cnt)

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, K = map(int, input().split())

count = 0
for m in range(K, N+2):
    
    ans = m * N - (m * (m - 1) - 1)
    
    if ans > 0:
        count += ans

print(count)

Failing test case input:
4850 976

Expected output:
27110257


Actual output:
17027110376


Fixed submission (verdict: Accepted):
N, K = map(int, input().split())

count = 0
for m in range(K, N+2):
    
    ans = m * N - (m * (m - 1) - 1)
    
    if ans > 0:
        count += ans

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

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k = map(int,input().split())
cnt = 0
for i in range(k,n+2):
    cnt += n * (n + 1) / 2 - (n - i) * (n - i + 1) / 2 - i * (i - 1) / 2 + 1
print(cnt % (10 ** 9 + 7))

Failing test case input:
1000 410

Expected output:
106128432


Actual output:
106128432.0


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())
cnt = 0
for i in range(k,n+2):
    cnt += n * (n + 1) / 2 - (n - i) * (n - i + 1) / 2 - i * (i - 1) / 2 + 1
print(int(cnt % (10 ** 9 + 7)))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int, input().split())
mod = pow(10,9) + 7

def cal(a,i):
  min = i*(i-1)/2
  max = a*(a-1)/2 - (a-i)*(a-i-1)/2
  return max - min + 1

count = 0
for i in range(a-b+2):
  count += cal(a,i+b)
print(count % mod)


Failing test case input:
1100 227

Expected output:
198071125


Actual output:
197490125.0


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
mod = pow(10,9) + 7

def cal(a,i):
  min = i*(i-1)/2
  max = a*(a-1)/2 - (a-i)*(a-i-1)/2
  return max - min + 1

count = 0
for i in range(a-b+2):
  count += cal(a+1,i+b)
print(int(count % mod))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K = map(int,input().split())
ans = 0
mod = 10**9+7
for k in range(K,N+2):
    ans += (k*(N-k+1)+1) % mod
print(ans)


Failing test case input:
107814 81103

Expected output:
472847449


Actual output:
12744472936657


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
ans = 0
mod = 10**9+7
for k in range(K,N+2):
    ans += (k*(N-k+1)+1)
print(ans % mod)
Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = list(map(int, input().split()))
n = a[0]
k = a[1]
Sum = 0

for i in range(n-k+2):
  Sum += int((2*n-k-i+1)*(k+i)/2-(k+i-1)*(k+i)/2+1)
print(Sum)

Failing test case input:
141421 35623

Expected output:
220280457

Actual output:
396749223057700


Fixed submission (verdict: Accepted):
a = list(map(int, input().split()))
n = a[0]
k = a[1]
Sum = 0
 
for i in range(n-k+2):
  Sum += int((2*n-k-i+1)*(k+i)/2-(k+i-1)*(k+i)/2+1)
print(Sum%(10**9+7))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,K = map(int,input().split())
a =0
for i in range(K,N+2):
    a = a + ((N+N-i+1)*i/2-(i-1)*(i)/2+1)
print(a%10**9+7)

Failing test case input:
1111 5

Expected output:
229162654


Actual output:
229162661.0


Fixed submission (verdict: Accepted):
N,K = map(int,input().split())
a =0
for i in range(K,N+2):
    a = a + ((N+N-i+1)*i/2-(i-1)*(i)/2+1)
print(int(a % (10**9+7)))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,K = list(map(int,input().split()))

ans = 0
for k in range(K,n+2):
  
  
  
  
  
  ans += n*k - k**2 + k  + 1
print(ans)

Failing test case input:
10163 4398

Expected output:
72432465


Actual output:
105072433200


Fixed submission (verdict: Accepted):
n,K = list(map(int,input().split()))
mod = 10**9+7
ans = 0
for k in range(K,n+2):
  
  
  
  
  
  ans += n*k - k**2 + k  + 1
print(ans%mod)

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def sum_part(N, k):
  return k*(2*N-k+1)/2-k*(k-1)/2+1
  
N, K = map(int, input().split())
ans = 0
for k in range(K,N+2):
  ans += sum_part(N, k)
  
ans = ans % (10**9 + 7)
  
print(ans)

Failing test case input:
1011 1

Expected output:
172739798


Actual output:
172739798.0


Fixed submission (verdict: Accepted):
def sum_part(N, k):
  return k*(2*N-k+1)/2-k*(k-1)/2+1
  
N, K = map(int, input().split())
ans = 0
for k in range(K,N+2):
  ans += sum_part(N, k)
  
ans = ans % (10**9 + 7)
  
print(int(ans))

Problem: p02708
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n,k=map(int,input().split())
sum=0
M=1000000007
print(((2*n-k+1)*k)/2,(k*(k-1))/2)
for i in range(k,n+2):
    sum=(2*n-i+1)*i/2-(i*(i-1))/2+1+sum
    sum=sum%M
print(int(sum)%M)

Failing test case input:
1001 2

Expected output:
167668501


Actual output:
2001.0 1.0
167668501


Fixed submission (verdict: Accepted):
n,k=map(int,input().split())
sum=0
M=1000000007
for i in range(k,n+2):
    sum=(2*n-i+1)*i/2-(i*(i-1))/2+1+sum
    sum=sum%M
print(int(sum)%M)

Problem: p02708
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
X=list(map(int,input().split()))
N=X[0]
K=X[1]
ans=0
for i in range(K,N+2):
  ans+=N*i-(i*i)+i+1
print(int(ans))

Failing test case input:
206306 200001

Expected output:
7746530


Actual output:
4019007774663


Fixed submission (verdict: Accepted):
X=list(map(int,input().split()))
N=X[0]
K=X[1]
ans=0
MOD=10**9+7
for i in range(K,N+2):
  ans+=(N*i-pow(i,2,MOD)+i+1)%MOD
  ans%=MOD
print(int(ans))