ZhenlongDai/ACPR huggingface dataset:
Problem: p02842
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
for i in range(n):
  if i * 1.08 == n:
    print(i)
    exit()
print(":(")

Failing test case input:
164

Expected output:
152


Actual output:
:(


Fixed submission (verdict: Accepted):
n = int(input())
for i in range(50001):
  if int(i * 1.08) == n:
    print(i)
    exit()
print(":(")

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

ans = 0
for i in range(n):
    if int(i*1.08)==n:
        ans = i
        break
print(ans) if ans!=0 else ':('

Failing test case input:
1079

Expected output:
:(

Actual output:

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

ans = 0
for i in range(n+1):
    if int(i*1.08)==n:
        ans = i
        break
if ans!=0:
    print(ans) 
else:
    print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = []
for i in range(n):
  if int(i * 1.08) == n:
    print(int(i * 1.08))
    exit()
  
print(':(')

Failing test case input:
685

Expected output:
635


Actual output:
685


Fixed submission (verdict: Accepted):
n = int(input())
import math
for i in range(50000):
  if math.floor(i*1.08) == n:
    print(i)
    exit()
   

  
print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
if n % 27 == 13 or n % 27 == 26:
    print(':(')
else:
    print(int(n / 1.08) + 1)


Failing test case input:
432

Expected output:
400

Actual output:
401


Fixed submission (verdict: Accepted):
n = int(input())
if n % 27 == 13 or n % 27 == 26:
    print(':(')
elif n % 27 == 0:
    print(int(n / 1.08))
else:
    print(int(n / 1.08) + 1)

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
for i in range(1,50001):
    if i*1.08==n:
        print(i)
        exit()
print(":(")


Failing test case input:
685

Expected output:
635


Actual output:
:(


Fixed submission (verdict: Accepted):
n=int(input())
for i in range(1,50001):
    if int(i*1.08)==n:
        print(i)
        exit()
print(":(")

Problem: p02842
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

ans = []

num = int(input())

for i in range(1,50001):
    ans.append(int(i*1.08))

print(my_index(ans,num-1,":("))

Failing test case input:
164

Expected output:
152


Actual output:
150


Fixed submission (verdict: Accepted):
def my_index(l, x, default=False):
    if x in l:
        return int(l.index(x))+1
    else:
        return default
 
ans = []
 
num = int(input())
 
for i in range(1,50001):
    ans.append(int(i*1.08))
 
print(my_index(ans,num,":("))
Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
flg=False
ans=0
for n in range(1, N+1):
  if (int(1.08*n) == N):
    ans=n
    flg=True
if flg:
  print(n)
else:
  print(':(')


Failing test case input:
141

Expected output:
131


Actual output:
141


Fixed submission (verdict: Accepted):
N=int(input())
flg=False
ans=0
for n in range(1, N+1):
  if (int(1.08*n) == N):
    ans=n
    flg=True
if flg:
  print(ans)
else:
  print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
if N%27!=26 and N%27!=13:
  print(round(N/1.08))
else:
  print(':(')

Failing test case input:
416

Expected output:
386


Actual output:
385


Fixed submission (verdict: Accepted):
import math
N = int(input())
if N%27!=26 and N%27!=13:
  print(math.ceil(N/1.08))
else:
  print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
x = int(input())
ans = math.ceil(x/1.08)
if x == (ans * 1.08):
    print(ans)
else:
    print(":(")

Failing test case input:
328

Expected output:
304


Actual output:
:(


Fixed submission (verdict: Accepted):
import math
x = int(input())
ans = math.ceil(x/1.08)
if x == math.floor(ans * 1.08):
    print(ans)
else:
    print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())

f = N 

ok = False
while True:
  n = math.ceil(f * 1.08)
  if n == N:
    ok = True
    break
  elif N < n:
    break
    
  f += 1
  
if not ok:
  print(':(')
else:
  print(n)
  

Failing test case input:
416

Expected output:
386


Actual output:
:(


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

f = int(N 

ok = False
while True:
  n = math.floor(f * 1.08)
  if n == N:
    ok = True
    break
  elif N < n:
    break
    
  f += 1
  
if not ok:
  print(':(')
else:
  print(f)

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
flag=False

for i in range(50000):
  if int(i*1.08) ==N:
    print(i)
    flag=True
    break
    
if flag==False:
  print(":)")

Failing test case input:
1079

Expected output:
:(

Actual output:
:)


Fixed submission (verdict: Accepted):
N = int(input())
flag=False

for i in range(50000):
  if int(i*1.08) ==N:
    print(i)
    flag=True
    break
    
if flag==False:
  print(":(")

Problem: p02842
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n = int(input())
x = n/1.08
x1, x2 = math.floor( x ), math.ceil( x )
print(x1, x2)

if n == math.floor( x1 * 1.08 ) :
  print(x1)
elif n == math.floor( x2 * 1.08 ):
  print(x2)
else:
  print(':(')

Failing test case input:
1079

Expected output:
:(

Actual output:
999 1000
:(


Fixed submission (verdict: Accepted):
import math
n = int(input())
x = n/1.08
x1, x2 = math.floor( x ), math.ceil( x )

if n == math.floor( x1 * 1.08 ) :
  print(x1)
elif n == math.floor( x2 * 1.08 ):
  print(x2)
else:
  print(':(')
Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
a = int(input())
x = a/1.08
if not x.is_integer():
    b = math.ceil(x)
    c = math.floor(x)
    if round(c*1.08) == a:
        print(c)
    elif round(b*1.08) == a:
        print(b)
    else:
        print(":(")
else:
    if round(x*1.08) == a:
        print(int(x))
    else:
        print(":(")

Failing test case input:
322

Expected output:
299


Actual output:
298


Fixed submission (verdict: Accepted):
import math
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
a = int(input())
x = a/1.08
if not x.is_integer():
    b = math.ceil(x)
    c = math.floor(x)
    if int(c*1.08) == a:
        print(c)
    elif int(b*1.08) == a:
        print(b)
    else:
        print(":(")
else:
    if int(x*1.08) == a:
        print(int(x))
    else:
        print(":(")

Problem: p02842
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
N=int(input())
a=math.ceil(N/(1.08))
t=0
for i in range(a,N):
    if math.floor(i*1.08)==N:
        print(i)
        t=t+1
    else:
        print(':(')

Failing test case input:
328

Expected output:
304


Actual output:
304
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(


Fixed submission (verdict: Accepted):
import math
N=int(input())
a=math.ceil(N/(1.08))
if math.floor(a*1.08)==N:
        print(a)
else:
        print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ans=round(n/1.08)
if(int(ans*1.08)!= n):
    if(int((ans+1)*1.08)!= n)&((int((ans-1)*1.08)!= n)):
        print(":(")
else:
    print(ans)

Failing test case input:
332

Expected output:
308


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
ans=int(n/1.08)
if(int(ans*1.08)!= n):
    if(int((ans+1)*1.08)== n):
        print(int(ans+1))
    elif((int((ans-1)*1.08)== n)):
        print(int(ans+1))
    else:
        print(":(")
else:
    print(ans)

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N = int(input())
x = int(N/1.08)
if x*1.08 == N:
  print(x)
else:
  print(":(")

Failing test case input:
141

Expected output:
131


Actual output:
:(


Fixed submission (verdict: Accepted):

import math
N = int(input())
x = math.ceil(N/1.08)
if math.floor(x*1.08) == N:
  print(x)
else:
  print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = N/1.08
b = (N+1)/1.08

inta = int(a)
if inta==a:
    print(inta)
elif inta==int(b) or inta+1==int(b):
    print(':(')
else:
    print(inta+1)

Failing test case input:
442

Expected output:
410


Actual output:
:(


Fixed submission (verdict: Accepted):
N = int(input())
a = N/1.08
b = (N+1)/1.08

inta = int(a)
if inta==a:
    print(inta)
elif inta==int(b) or (int(b)==b and inta+1==int(b)):
    print(':(')
else:
    print(inta+1)
Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

for i in range(n):
	if int(i * 1.08) == n:
		print(int(i))
		exit()
	else:
		print(":(")

Failing test case input:
332

Expected output:
308


Actual output:
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
:(
308


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

for i in range(n + 1) :
	if int(i * 1.08) == n:
		print(i)
		break
else:
	print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
w = round(N / 1.08)
ans = int(w * 1.08)
if ans == N:
    print(w)
elif int(w + 1 * 1.08) == N:
    print(w + 1)
elif int(w - 1 * 1.08) == N:
    print(w - 1)
else:
    print(":(")

Failing test case input:
439

Expected output:
407


Actual output:
:(


Fixed submission (verdict: Accepted):
N = int(input())
w = round(N / 1.08)
ans = int(w * 1.08)
if ans == N:
    print(w)
elif int((w + 1) * 1.08) == N:
    print(w + 1)
elif int((w - 1) * 1.08) == N:
    print(w - 1)
else:
    print(":(")

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

import math
x = math.ceil(n/1.08)
if n == math.ceil(x*1.08):
    print(x)
else:
    print(':(')

Failing test case input:
311

Expected output:
288


Actual output:
:(


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

import math
x = math.ceil(n/1.08)
if n == math.floor(x*1.08):
	print(x)
else:
	print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n = int(input())
if math.ceil(((n*100)/108) * 1.08) == n:
    print(math.ceil((n*100)/108))
  
else:
    print(":(")



Failing test case input:
369

Expected output:
342


Actual output:
:(


Fixed submission (verdict: Accepted):
import math
n = int(input())
if math.floor(math.ceil((n*100)/108) * 1.08) == n:
    print(math.ceil((n*100)/108))
  
else:
    print(":(")
Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
from math import floor
N = int(input())
X = floor(float(N/(1.08)))

if X==N:
    print(X)
else:
    print(":(")


Failing test case input:
221

Expected output:
205


Actual output:
:(


Fixed submission (verdict: Accepted):
import math
from math import ceil, floor
N = int(input())
X = ceil(N/(1.08))
M = floor(X*1.08)

if M==N:
    print(X)
else:
    print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
for i in range(1,46300):
	p=i*1.08
	if p==n:
	    print(i)
	    exit()
print(":(")

Failing test case input:
140

Expected output:
130


Actual output:
:(


Fixed submission (verdict: Accepted):
n=int(input())
import math
for i in range(1,46300):
	p=math.floor(i*1.08)
	if p==n:
	    print(i)
	    exit()
print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
x=n/1.08
x_int=round(x)
a=int(x_int*1.08)
if a==n:
    print(x_int)

else:
    print(':(')



Failing test case input:
439

Expected output:
407


Actual output:
:(


Fixed submission (verdict: Accepted):
n=int(input())
x=n/1.08
x_int=round(x)
a=int(x_int*1.08)
if int(x_int*1.08)==n:
    print(x_int)
elif int((x_int+1)*1.08)==n:
    print(x_int+1)
else:
    print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
Ans = 0
 

Ans = N * 100 / 108
A = math.ceil(Ans)

if math.floor(A * 1.08) != A:
  print(':(')
else:
  print(A)

Failing test case input:
140

Expected output:
130


Actual output:
:(


Fixed submission (verdict: Accepted):
import math
N = int(input())
Ans = 0

if N % 27 == 13 or N % 27 == 26:
  print(':(')
else:
  Ans = N * 100 / 108
  A = math.ceil(Ans)
  print(A)

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
if int(n/1.08)*1.08>=n:
  print(int(n/1.08))
else:
  print(':(')

Failing test case input:
416

Expected output:
386


Actual output:
:(


Fixed submission (verdict: Accepted):
n=int(input())
if n+1>int((n+1)/1.08)*1.08>=n:
  print(int((n+1)/1.08))
else:
  print(':(')

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

n = int(input())
ans = ':('
a = n / 1.08

for i in range(math.floor(a - 2) , math.ceil(a + 2)):
  if math.floor(i * 1.08) == n:
    ans = i
    print(i)
    break

Failing test case input:
1079

Expected output:
:(

Actual output:

Fixed submission (verdict: Accepted):
import math

n = int(input())
ans = ':('
a = n / 1.08

for i in range(math.floor(a - 2) , math.ceil(a + 2)):
  if math.floor(i * 1.08) == n:
    ans = i
    break

print(ans)

Problem: p02842
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n=int(input())
x=n/1.08
nn=x*1.08
if math.floor(nn)==n:    
	print(math.ceil(x))
else:
  print(":(")

Failing test case input:
1079

Expected output:
:(

Actual output:
1000


Fixed submission (verdict: Accepted):
import math
n=int(input())
xc=math.ceil(n/1.08)
nn=xc*1.08
if math.floor(nn)==n:    
	print(xc)
else:
  print(":(")
Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
memo=[]
for i in range(1,n+1):
  memo.append(int(i*1.08))

if n in memo:
  print(memo.index(n)+1)
else:
  print("a")

Failing test case input:
1079

Expected output:
:(

Actual output:
a


Fixed submission (verdict: Accepted):
n=int(input())
memo=[]
for i in range(1,n+1):
  memo.append(int(i*1.08))

if n in memo:
  print(memo.index(n)+1)
else:
  print(":(")

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

n = int(input())

x = n/1.08

x = round(x)

print(x)

m = math.floor(x * 1.08)

print(m)

if n != m:
    print(":(")
else:
    print(x) 

Failing test case input:
140

Expected output:
130


Actual output:
130
140
130


Fixed submission (verdict: Accepted):
import math

n = int(input())

x = round(n/1.08)

m = math.floor(x * 1.08)

if n != m:
    x=x+1
    m = math.floor(x * 1.08)
    if n != m:
        print(":(")
    else:
        print(x) 
else:
    print(x)

Problem: p02842
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
N = int(input())

for x in range(1, 50001):
    temp = x * 1.08

    if N <= temp < (N + 0.5):
        print(x)
        sys.exit()

print(":(")


Failing test case input:
416

Expected output:
386


Actual output:
:(


Fixed submission (verdict: Accepted):
import sys
N = int(input())

for x in range(1, 50001):
    temp = x * 1.08

    if N <= temp < (N + 1):
        print(x)
        sys.exit()

print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin


def input():
    return stdin.readline()[:-1]


def intput():
    return int(input())


def sinput():
    return input().split()


def intsput():
    return map(int, sinput())




n = intput()

x = round(n / 1.08)


for t in range(x - 1000, x + 1000):
    if round(t * 1.08) == n and t > 0:
        print(t)
        break
else:
    print(":(")


Failing test case input:
452

Expected output:
419


Actual output:
:(


Fixed submission (verdict: Accepted):
from sys import stdin


def input():
    return stdin.readline()[:-1]


def intput():
    return int(input())


def sinput():
    return input().split()


def intsput():
    return map(int, sinput())




n = intput()

x = round(n / 1.08)


for t in range(x - 1000, x + 1000):
    if int(t * 1.08) == n and t > 0:
        print(t)
        break
else:
    print(":(")

Problem: p02842
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
 
ans = ":("
for X in range(1, N):
  if X * 1.08 >= N:
    ans = X
    break
  elif X * 1.08 > N+1:
    break
    
print(ans)

Failing test case input:
1079

Expected output:
:(

Actual output:
1000


Fixed submission (verdict: Accepted):
N = int(input())
 
ans = ":("
 
for X in range(N+1):
  if int(X * 1.08) == N:
    ans = X
    break
    
print(ans)
Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
X=int(N*100/108)
print([':(',X][int(X*1.08)==N or int((X+1)*1.08)==N])

Failing test case input:
311

Expected output:
288


Actual output:
287


Fixed submission (verdict: Accepted):
N=int(input())
X=int(N*100/108)
print(X if int(X*1.08)==N else X+1 if int((X+1)*1.08)==N else ':(')

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

N = int(input())

X = int(N / 1.08)
X_min = int(X * 1.08)
X_max = int((X + 1) * 1.08)

print(X, X_min, X_max)

if X_min == N:
    print(X)
elif X_max == N:
    print(X + 1)
else:
    print(':(')

Failing test case input:
140

Expected output:
130


Actual output:
129 139 140
130


Fixed submission (verdict: Accepted):

N = int(input())

X = int(N / 1.08)
X_min = int(X * 1.08)
X_max = int((X + 1) * 1.08)

if X_min == N:
    print(X)
elif X_max == N:
    print(X + 1)
else:
    print(':(')

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

N = int(input())

X = math.ceil(N / 1.08)
converted = int(X * 1.08)
if X == converted:
    print(X)
else:
    print(':(')

Failing test case input:
416

Expected output:
386


Actual output:
:(


Fixed submission (verdict: Accepted):
import math

N = int(input())

X = math.ceil(N / 1.08)
converted = int(X * 1.08)
if N == converted:
    print(X)
else:
    print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
flag = False
x = int(n / 108 * 100)
for i in range(x,x+3):
    if int(i*1.08) == n:
        flag = True
if flag:
    print(x)
else:
    print(":(")

Failing test case input:
416

Expected output:
386


Actual output:
385


Fixed submission (verdict: Accepted):
n = int(input())
flag = False
x = int(n / 108 * 100)
for i in range(x-5,x+5):
    if int(i*1.08) == n:
        flag = True
        x = i
if flag:
    print(x)
else:
    print(":(")

Problem: p02842
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
N = int(input())
X = math.floor(N/1.08)
if N == X*1.08:
 print(X)
else:
 print(':(')


Failing test case input:
180

Expected output:
167


Actual output:
:(


Fixed submission (verdict: Accepted):
N = int(input())
import math
X = math.ceil(N/1.08)
if N == math.floor(X*1.08):
 print(X)
else:
 print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
x=int(n/1.08)
y=int((n+0.5)/1.08)
if int(x*1.08)==n:
  print(x)
elif int(y*1.08)==n:
  print(y)
else:
  print(':(')

Failing test case input:
452

Expected output:
419


Actual output:
:(


Fixed submission (verdict: Accepted):
n=int(input())
x=int(n/1.08)
y=int((n+1)/1.08)
if int(x*1.08)==n:
  print(x)
elif int(y*1.08)==n:
  print(y)
else:
  print(':(')
Problem: p02842
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
n = int(input())
a = math.floor(n / 1.08)
b = a + 1
c = math.floor(a * 1.08)
d = math.floor(b * 1.08)

if c == n:
  print(a)
elif b == d:
  print(b)
else:
  print(":(")

Failing test case input:
164

Expected output:
152


Actual output:
:(


Fixed submission (verdict: Accepted):
import math
n = int(input())
a = math.floor(n / 1.08)
b = a + 1
c = math.floor(a * 1.08)
d = math.floor(b * 1.08)

if c == n:
  print(a)
elif d == n:
  print(b)
else:
  print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
val = N / 1.08
val_min = math.floor(val)
val_max = val_min + 1
if (math.floor(val_min * 1.08) == N) or (math.floor(val_max * 1.08) == N):
    print(val_min)
else:
    print(":(")

Failing test case input:
332

Expected output:
308


Actual output:
307


Fixed submission (verdict: Accepted):
import math
N = int(input())
val = N / 1.08
val_min = math.floor(val)
val_max = val_min + 1
price_min = math.floor(val_min * 1.08)
price_max = math.floor(val_max * 1.08)
if price_min == N:
    print(val_min)
elif price_max == N:
    print(val_max)
else:
    print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())*100
x = N 
M = (x * 108) 
if N == M:
  print(x)
else:
  print(':(')

Failing test case input:
369

Expected output:
342


Actual output:
:(


Fixed submission (verdict: Accepted):
import math
N = int(input())*100
x = math.ceil(N / 108)
M = x*108
if M
  print(x)
else:
  print(':(')

Problem: p02842
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n=int(input())
if int(math.ceil(n/1.08)*1.08)==n:
    print(math.ceil(n/1.08))
else:
    print(":()")

Failing test case input:
1079

Expected output:
:(

Actual output:
:()


Fixed submission (verdict: Accepted):
import math
n=int(input())
if int(math.ceil(n/1.08)*1.08)==n:
    print(math.ceil(n/1.08))
else:
    print(":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=float(input())
x=int(N/1.08)
if N<=(x+1)*1.08<=N+1: 
  print(x+1)
elif N<=x*1.08<=N+1:
  print(x)
else:
  print(':(')

Failing test case input:
1079

Expected output:
:(

Actual output:
1000


Fixed submission (verdict: Accepted):
N=int(input())
x=int(N/1.08)
a=int(x*1.08)
b=int((x+1)*1.08)
if N==a:
  print(x)
  exit()
if N==b:
  print(x+1)
  exit()
else:
  print(':(')

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

k = n*100/108
k = int(k)

ans = ":("
for i in range(-1,2):
  if n==int(k*1.08):
    ans = k+i
print(ans)

Failing test case input:
332

Expected output:
308


Actual output:
:(


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

k = n*100/108
k = int(k)

ans = ":("
for i in range(k-1,k+2):
  if n==int(i*1.08):
    ans = i
print(ans)
Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

for i in range(1, 50001):
    t = int(i * 1.08)
    if t == n:
        print(i)
        break
    else:
        continue
    print(":(")
    break

Failing test case input:
1079

Expected output:
:(

Actual output:

Fixed submission (verdict: Accepted):
import math

ans = -1
n = int(input())

for i in range(1, n+1):
    if math.floor(i * 1.08) == n:
        ans = i
        break

print(ans if ans != -1 else ":(")

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
kari = N*100/108
hako = math.ceil(kari)
ans = math.floor(kari)
if  hako*108/100==N or ans*108/100==N:
    print(kari)
elif math.floor(hako*108/100)==N:
    print(hako)
elif math.floor(ans*108/100)==N:
    print(ans)
else:
    print(":(")

Failing test case input:
432

Expected output:
400

Actual output:
400.0


Fixed submission (verdict: Accepted):
import math
N = int(input())
kari = N*100/108
hako = math.ceil(kari)
ans = math.floor(kari)
if  hako*108/100==N or ans*108/100==N:
    print(math.floor(kari))
elif math.floor(hako*108/100)==N:
    print(hako)
elif math.floor(ans*108/100)==N:
    print(ans)

 

 
else:
    print(":(")

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

ans = 0
for i in range(N - int(N/20), N + int(N/20)):
    if int(i*1.08) == N:
        ans = i
        break

if ans != 0:
    print(ans)
else:
    print(":(")

Failing test case input:
442

Expected output:
410


Actual output:
:(


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

ans = 0
for i in range(1, N + 1):
    if int(i*1.08) == N:
        ans = i

if ans != 0:
    print(ans)
else:
    print(":(")

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

X = int(input())
a = math.ceil(X / 108 * 100)
b = math.floor(X / 108 * 100)

print(a, b)

if int(a / 100 * 108) == X:
    print(a)
elif int(b / 100 * 108) == X:
    print(b)
else:
    print(':(')


Failing test case input:
332

Expected output:
308


Actual output:
308 307
308


Fixed submission (verdict: Accepted):
import math

X = int(input())
a = math.ceil(X / 108 * 100)
b = math.floor(X / 108 * 100)

if int(a / 100 * 108) == X:
    print(a)
elif int(b / 100 * 108) == X:
    print(b)
else:
    print(':(')

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
n0 = int(n/1.08)-1

while int(n0 * 1.08) < n:
    n0 += 1

if int(n0 * 1.08) == n:
    print(int(n0 * 1.08))
else:
    print(':(')

Failing test case input:
686

Expected output:
636


Actual output:
686


Fixed submission (verdict: Accepted):
n = int(input())
n0 = int(n/1.08)

while int(n0 * 1.08) < n:
    n0 += 1

if int(n0 * 1.08) == n:
    print(n0)
else:
    print(':(')
Problem: p02842
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
n=int(input())
x=round(n/1.08)
if(math.floor(1.08*x)==n):
    print(x)
else:
    print(":(")

Failing test case input:
322

Expected output:
299


Actual output:
:(


Fixed submission (verdict: Accepted):
import math
n=int(input())
x=math.ceil(n/1.08)
if(math.floor(1.08*x)==n):
    ans=x
else:
    ans=str(":(")
print(ans)

Problem: p02842
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
x = int(n/1.08+.5)
print(x) if int(x * 1.08) == n else print(':(')

Failing test case input:
322

Expected output:
299


Actual output:
:(


Fixed submission (verdict: Accepted):
import math

n = int(input())

x = math.ceil(n/1.08)
print(x) if math.floor(x*1.08) == n else print(':(')
Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
H, N = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]
print(H, N)

INF = int(1e18)
dp = [INF] * (H + 1)
dp[H] = 0;
for i in range(N):
    for j in range(H, -1, -1):
        dp[max(0, j - A[i][0])] = min(dp[max(0, j - A[i][0])], dp[j] + A[i][1])

ans = dp[0]
print(ans)


Failing test case input:
18187 7
379 2752
979 10579
1778 10271
206 8993
415 1483
130 7083
434 878
219 2816
2 1272
72 2120

Expected output:
36876


Actual output:
18187 7
36876


Fixed submission (verdict: Accepted):
H, N = map(int, input().split())
A = [list(map(int, input().split())) for i in range(N)]

INF = int(1e18)
dp = [INF] * (H + 1)
dp[H] = 0;
for i in range(N):
    for j in range(H, -1, -1):
        dp[max(0, j - A[i][0])] = min(dp[max(0, j - A[i][0])], dp[j] + A[i][1])

ans = dp[0]
print(ans)

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
h, n = map(int, input().split())
m = [list(map(int, input().split())) for _ in range(n)]
INF = 10 ** 9
dp = [INF for _ in range(h + 1)]
dp[0] = 0
for a, b in m:
    for i in range(h + 1):
        if i + a > h:
            dp[h] = min(dp[h], dp[i] + b)
            break
        else:
            dp[i + a] = min(dp[i + a], dp[i] + b)
print(dp[h])


Failing test case input:
9999 10
540 7550
691 20670
700 9790
863 7150
415 5818
551 7712
587 8227
619 8671
588 8228
176 2461

Expected output:
85800


Actual output:
90686


Fixed submission (verdict: Accepted):
h, n = map(int, input().split())
m = [list(map(int, input().split())) for _ in range(n)]
INF = 10 ** 12
dp = [INF for _ in range(h + 1)]
dp[0] = 0
for a, b in m:
    for i in range(h + 1):
        if i + a > h:
            dp[h] = min(dp[h], dp[i] + b)
        else:
            dp[i + a] = min(dp[i + a], dp[i] + b)
print(dp[h])

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
H,N =map(int, input().split())
a = [] 
M = 0 
for i in range(N):
	t = list(map(int, input().split()))
	a.append(t)
	M = max(M,t[0])
dp = [10000]*(H+1+M)
dp[0] = 0
for i in range(H):
	for j,k in a:
		dp[i+j] = min(dp[i+j],dp[i]+k)

print(min(dp[H:]))

Failing test case input:
9999 5
540 4853
1222 7523
1778 16913
231 7150
415 769
118 7712
1118 8227
908 8671
94 4378
37 2120

Expected output:
19225


Actual output:
10000


Fixed submission (verdict: Accepted):
H,N =map(int, input().split())
a = [] 
M = 0 
for i in range(N):
	t = list(map(int, input().split()))
	a.append(t)
	M = max(M,t[0])
dp = [100000000]*(H+1+M)
dp[0] = 0
for i in range(H):
	for j,k in a:
		dp[i+j] = min(dp[i+j],dp[i]+k)

print(min(dp[H:]))
Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from math import floor
h,n = map(int,input().split())

magic = []
inf = float('INF')
dp = [inf for i in range(h+1)]
dp[0] = 0
for _ in range(n):
    a,b = map(int,input().split())
    for i in range(h+1):
        if i + a < h+1 and dp[i] + b < dp[i+a]:
            dp[i+a] = dp[i] + b
        elif i <= a and b < dp[i]:
            dp[i] = b
print(dp[h])



Failing test case input:
18187 7
379 2752
979 10579
1778 118
206 7150
415 2167
130 7083
560 878
219 8804
12 1272
72 2120

Expected output:
1298


Actual output:
8615


Fixed submission (verdict: Accepted):
from math import ceil
h,n = map(int,input().split())

inf = float('INF')
dp = [inf for i in range(h+1)]
dp[0] = 0
for _ in range(n):
    a,b = map(int,input().split())
    for i in range(h+1):
        idx = i-a if i >= a else 0
        if i >= a and dp[i] > dp[idx] + b:
            dp[i] = dp[i-a] + b
        elif i <= a and b < dp[i]:
            dp[i] = b
print(dp[h])

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
H,N = map(int,input().split())
magic = list(list(map(int,input().split()))for i in range(N))

DP = [0]*(H+1)
for i in range(H+1):
    DP[i] = math.ceil(i/magic[0][0])*magic[0][1]
for i in range(1,N):
    for j in range(magic[i][0],H+1):
        DP[j] = min(DP[j],DP[j-magic[i][0]]+magic[i][1])
print(DP[-1])



Failing test case input:
18187 7
379 2752
452 16647
1012 5557
379 7150
473 187
164 8612
798 878
48 8600
6 2361
72 1078

Expected output:
7293


Actual output:
9858


Fixed submission (verdict: Accepted):
H,N = map(int,input().split())
magic = list(list(map(int,input().split()))for i in range(N))

DP = [10**9]*(H+1)
DP[0] = 0
for a,b in magic:
    for i in range(min(a,H+1)):
        DP[i] = min(DP[i],b)
    for i in range(a,H+1):
        DP[i] = min(DP[i],DP[i-a]+b)
print(DP[-1])

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):

     

import math



H,N = map(int,input().split())
Damage = []
Cost = []


DP = [0] + [pow(10,9)] * (H+1)



for i in range(N):
    a,b = map(int,input().split())
    Damage.append(a)
    Cost.append(b)
    





for i in range(1,len(DP)):
    for spell in range(N):
        DP[i] = min(DP[i],DP[max(0,i-Damage[spell])]+Cost[spell])




Failing test case input:
9999 7
197 2752
1222 10579
1778 16913
231 7150
577 1085
129 7083
376 10801
1028 8975
94 5576
72 2120

Expected output:
19530


Actual output:

Fixed submission (verdict: Accepted):

     

import math



H,N = map(int,input().split())
Damage = []
Cost = []


DP = [0] + [pow(10,9)] * (H+1)



for i in range(N):
    a,b = map(int,input().split())
    Damage.append(a)
    Cost.append(b)
    





for i in range(1,len(DP)):
    for spell in range(N):
        DP[i] = min(DP[i],DP[max(0,i-Damage[spell])]+Cost[spell])




print (DP[H])
Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
INF = 1000000000

h, n = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(n)]

maxA = max(AB[:][0])

dp = [INF for i in range(h+maxA)]
dp[0] = 0

for i in range(1, h+maxA):
    for ab in AB*2:
        a, b = ab[0], ab[1]
        if i-a >= 0:
            dp[i] = min(dp[i], dp[i-a] + b)

print(min(dp[h:]))


Failing test case input:
110 6
1 1
1 3
3 1
0 27
10 81
5 243

Expected output:
37


Actual output:
38


Fixed submission (verdict: Accepted):
INF = 1000000000

h, n = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(n)]

maxA = max(AB, key=lambda x: x[0])[0]

dp = [INF for i in range(h+maxA)]
dp[0] = 0

for i in range(1, h+maxA):
    dp[i] = min(dp[i-a] + b for a, b in AB)

print(min(dp[h:]))

Problem: p02787
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
H, N = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]


dp = [100000000] * (H + 10 ** 4 + 1)


for i in range(H):
    if dp[i] == 100000000:
        continue
    for a, b in AB:
        
        t = dp[i] + b
        
        if t < dp[i + a]:
            dp[i + a] = t

print(min(dp[H:]))




Failing test case input:
9999 10
540 7550
1201 9680
700 9790
510 7150
415 5818
551 7712
587 8227
619 8671
588 8228
176 2461

Expected output:
83258


Actual output:
100000000


Fixed submission (verdict: Accepted):
def main():
    from sys import stdin
    readline = stdin.readline
    H, N = map(int, readline().split())
    AB = [list(map(int, readline().split())) for _ in range(N)]

    dp = [100000000] * (H + 10 ** 4 + 1)
    dp[0] = 0
    for i in range(H):
        if dp[i] == 100000000:
            continue
        for a, b in AB:
            t = dp[i] + b
            if t < dp[i + a]:
                dp[i + a] = t
    print(min(dp[H:]))


main()

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
h, n = map(int, input().split())
m = [list(map(int, input().split())) for _ in range(n)]
INF = 10 ** 12
dp = [INF for _ in range(h + 1)]
dp[0] = 0
for a, b in m:
    for i in range(h + 1):
        if i + a > h:
            dp[h] = min(dp[h], dp[i] + b)
            break
        else:
            dp[i + a] = min(dp[i + a], dp[i] + b)
print(dp[h])


Failing test case input:
9999 5
540 4853
1222 7523
1778 16913
231 7150
415 769
118 7712
1118 8227
908 8671
94 4378
37 2120

Expected output:
19225


Actual output:
44455


Fixed submission (verdict: Accepted):
h, n = map(int, input().split())
m = [list(map(int, input().split())) for _ in range(n)]
INF = 10 ** 12
dp = [INF for _ in range(h + 1)]
dp[0] = 0
for a, b in m:
    for i in range(h + 1):
        if i + a > h:
            dp[h] = min(dp[h], dp[i] + b)
        else:
            dp[i + a] = min(dp[i + a], dp[i] + b)
print(dp[h])
Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
H,N = map(int,(input().split()))
dp = [10**9]*(H+1)
dp[0] = 0

A = [list(map(int,(input().split()))) for _ in range(N)]
print(A)

for i in range(H+1):
    for j,k in A:
        next = min(H,i+j)
        dp[next] = min(dp[next],dp[i]+k)

print(dp[H])

Failing test case input:
13715 9
289 4853
1222 12181
1778 5729
231 7150
415 1085
118 7083
589 8227
1028 8975
94 5576
49 2120

Expected output:
36890


Actual output:
[[289, 4853], [1222, 12181], [1778, 5729], [231, 7150], [415, 1085], [118, 7083], [589, 8227], [1028, 8975], [94, 5576]]
36890


Fixed submission (verdict: Accepted):
H,N = map(int,(input().split()))
dp = [10**9]*(H+1)
dp[0] = 0

A = [list(map(int,(input().split()))) for _ in range(N)]

for i in range(H+1):
    for j,k in A:
        next = min(H,i+j)
        dp[next] = min(dp[next],dp[i]+k)

print(dp[H])

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
[H,N]=[int(i) for i in input().split()]
DP=[100000000 for i in range(H)]
DP[0]=0
for n in range(N):
  [A,B]=[int(i) for i in input().split()]
  for h in range(N):
    if h-A>-1 and DP[h-A]+B<DP[h]:DP[h]=DP[h-A]+B
print(DP[H-1])

Failing test case input:
30956 7
197 2752
1222 10579
1778 16891
379 7150
415 1085
118 7083
560 10801
1840 8975
94 737
72 2120

Expected output:
81375


Actual output:
100000000


Fixed submission (verdict: Accepted):
[H,N]=[int(i) for i in input().split()]
A=[0 for i in range(N)]
B=[0 for i in range(N)]
for n in range(N):
  [A[n],B[n]]=[int(i) for i in input().split()]
k=H+max(A)+1
DP=[100000000 for i in range(k)]
DP[0]=0
for n in range(N):
  for h in range(k):
    if h-A[n]>-1:
    	if DP[h-A[n]]+B[n]<DP[h]:DP[h]=DP[h-A[n]]+B[n]
print(min(DP[H:]))

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
h,n=map(int,input().split())
d=[list(map(int,input().split()))for i in range(n)]
p=[float("INF")]*max(h+1,2*d[-1][0]+1)
p[0]=0
s=max(h+1,2*d[-1][0]+1)
for i in range(n):
    a,b=d[i][0],d[i][1]
    for j in range(a,h+1):
        if p[j]>p[j-a]+b:
            p[j]=p[j-a]+b
print(min(p[h:]))

Failing test case input:
24210 7
630 2752
1939 10579
1778 10271
206 7150
415 1085
118 7083
560 878
3260 8600
12 1223
72 2120

Expected output:
38632


Actual output:
49412


Fixed submission (verdict: Accepted):
h,n=map(int,input().split())
p=[float("INF")]*(h+1)
p[0]=0
for i in range(n):
    a,b=map(int,input().split())
    for j in range(h+1):
        if p[min(h,j+a)]>p[j]+b:
            p[min(j+a,h)]=p[j]+b
print(p[-1])
Problem: p02787
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def chmin(dp, i, *x):
  dp[i] = min(dp[i], *x)
INF = float("inf")


h, n = map(int, input().split())
dp = [INF]*-~h
for _ in [None]*n:
  a, b = map(int, input().split())
  for j in range(h + 1):
    chmin(dp, min(j + a, h), dp[j] + b)
print(dp[h])

Failing test case input:
13356 7
379 2752
979 10579
1012 10271
187 7150
338 2513
130 13207
798 878
28 8600
6 2361
72 754

Expected output:
14926


Actual output:
inf


Fixed submission (verdict: Accepted):
def chmin(dp, i, *x):
  dp[i] = min(dp[i], *x)
INF = float("inf")


h, n = map(int, input().split())
dp = [0] + [INF]*h
for _ in [None]*n:
  a, b = map(int, input().split())
  for j in range(h + 1):
    chmin(dp, min(j + a, h), dp[j] + b)
print(dp[h])

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

INF = 1 << 60

dp = [INF] * (h + 1)
dp[0] = 0

for i in range(1, h + 1):
    
    for a, b in ab:
        p = max(i - a, 0)
        if dp[p] + a >= i:
            dp[i] = min(dp[i], dp[p] + b)

print(dp[-1])

Failing test case input:
9 3
8 3
4 4
4 1

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
h, n = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

INF = 1 << 60

dp = [INF] * (h + 1)
dp[0] = 0

for i in range(0, h + 1):
    
    for a, b in ab:
        if i + a <= h:
            dp[i + a] = min(dp[i] + b, dp[i + a])
        else:
            dp[h] = min(dp[i] + b, dp[h])

print(dp[h])

Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
H, N = map(int, input().split())
inf =10*10
dp = [inf for _ in range(H+1)]


dp[0]=0
for n in range(N):
    a,b =  map(int, input().split())
    for h in range(H):
        nj = min(h+a,H)
        dp[nj] = min([dp[nj],dp[h]+b])
        
print(int(dp[H]))


Failing test case input:
9999 9
197 4853
1222 12181
1778 16913
231 7150
415 966
118 7083
589 8227
1028 8975
94 5576
49 2120

Expected output:
24150


Actual output:
100


Fixed submission (verdict: Accepted):
H, N = map(int, input().split())
inf =1000100001001000
dp = [inf for _ in range(H+1)]
 

dp[0]=0
for n in range(N):
    a,b =  map(int, input().split())
    for h in range(H):
        nj = min(h+a,H)
        dp[nj] = min([dp[nj],dp[h]+b])
        
print(int(dp[H]))
Problem: p02787
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
h,n = map(int, input().split())
x = [list(map(int, input().split())) for i in range(n)]


dp=[10**20 for i in range(h+1)]
dp[0]=0

for i in range(h+1):
    for j in range(n):
        if x[j][0]<=i:
            dp[i]=min(dp[i],dp[i-x[j][0]]+x[j][1])
print(dp[-1])


Failing test case input:
9999 5
289 4853
1222 4934
1778 16913
231 7150
5 769
118 7712
1118 8227
1028 8975
94 5576
37 2120

Expected output:
44325


Actual output:
58803


Fixed submission (verdict: Accepted):
h,n = map(int, input().split())
x = [list(map(int, input().split())) for i in range(n)]


dp=[10**20 for i in range(h+1)]
dp[0]=0

for i in range(h+1):
    for j in range(n):
        if i-x[j][0]<0:
            dp[i] = min(dp[i], dp[0] + x[j][1])

        else:
            dp[i]=min(dp[i],dp[i-x[j][0]]+x[j][1])
print(dp[-1])
Problem: p03731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

N, T = map(int, input().split())
tl = list(map(int, input().split()))

s = tl[0]
ans = s + T

for i in range(1, N):
    plus = min(T, tl[i]-ans)
    ans += plus

print(ans)

Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
3


Fixed submission (verdict: Accepted):

N, T = map(int, input().split())
tl = list(map(int, input().split()))

tl.append(float("inf"))

ans = 0

for i in range(N):
    if tl[i]+T>tl[i+1]:
        ans += tl[i+1] - tl[i]
    else:
        ans += T

print(ans)

Problem: p03731
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,k = map(int,input().split())

a = list(map(int,input().split()))
b = []
for i in range(n-1):
    b.append(a[i+1]-a[i])
su = 0
for i in range(n-1):
    if b[i] >= k:
        su += k
    else:
        su += b[i]
print(su)

Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
3


Fixed submission (verdict: Accepted):
n,k = map(int,input().split())

a = list(map(int,input().split()))
b = []
for i in range(n-1):
    b.append(a[i+1]-a[i])
su = 0
for i in range(n-1):
    if b[i] >= k:
        su += k
    else:
        su += b[i]
print(su+k)

Problem: p03731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
num,time = map(int, input().split())
times = [int(n) for n in input().split()]
stop = time
total = 0
for i in range(1,num):
    if times[i]<=stop:
        total += times[i]-times[i-1]
    else:
        total += stop-times[i-1]
    stop = times[i]+time
total += times[-1]+time
print(total)


Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
10


Fixed submission (verdict: Accepted):
num,time = map(int, input().split())
times = [int(n) for n in input().split()]
stop = time
total = 0
for i in range(1,num):
    if times[i]<=stop:
        total += times[i]-times[i-1]
    else:
        total += stop-times[i-1]
    stop = times[i]+time
total += time
print(total)

Problem: p03731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, t = map(int, list(input().split(' ')))
ti = list(map(int, list(input().split(' '))))
result = 10

for i, item in enumerate(ti):
  temp = t
  if i == len(ti) - 1:
    break
  if ti[i+1] - ti[i] < t:
    temp = ti[i+1] - ti[i]
  result = result + temp

print(result)


Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
13


Fixed submission (verdict: Accepted):
n, t = map(int, list(input().split(' ')))
ti = list(map(int, list(input().split(' '))))
result = t
for i, item in enumerate(ti):
  temp = t
  if i == len(ti) - 1:
    break
  if ti[i+1] - ti[i] < t:
    temp = ti[i+1] - ti[i]
  result = result + temp

print(result)

Problem: p03731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, t = map(int, input().split())
t_l = [int(i) for i in input().split()]

cost = t

for i in range(n - 1):
    t += min(t, t_l[i] - t_l[i - 1])
print(cost)


Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
4


Fixed submission (verdict: Accepted):
n, t = map(int, input().split())
t_l = [int(i) for i in input().split()]

cost = t

for i in range(1, n):
    cost += min(t, t_l[i] - t_l[i - 1])
print(cost)
Problem: p03731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, T = [int(i) for i in input().split()]
t = [int(i) for i in input().split()]

print(n, T, t)

sum = 0

for i in range(1,n):
    interval = t[i] - t[i-1]
    if interval < T:
        sum += interval
    else:
        sum += T

sum += T

print(sum)


Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
2 4 [0, 3]
7


Fixed submission (verdict: Accepted):
n, T = [int(i) for i in input().split()]
t = [int(i) for i in input().split()]



sum = 0

for i in range(1,n):
    interval = t[i] - t[i-1]
    if interval < T:
        sum += interval
    else:
        sum += T

sum += T

print(sum)

Problem: p03731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
tmp = list(map(int,input().split()))
n,t = tmp[0],tmp[1]
ts = list(map(int,input().split()))
ans = t
for i in ts[1:]:
  if i < t:
    ans += (t-i)
  else:
    ans += t
print(ans)

Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
5


Fixed submission (verdict: Accepted):
tmp = list(map(int,input().split()))
n,t = tmp[0],tmp[1]
ts = list(map(int,input().split()))
ans = t
for i in range(n-1):
  if ts[i+1] - ts[i] < t:
    ans += ts[i+1] - ts[i]
  else:
    ans += t
print(ans)

Problem: p03731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split(" "))
t = list(map(int, input().split(" ")))

shower = 0

for i in range(1, N):
    if t[i] >= T:
        shower += T
    else:
        shower += t[i]

print(shower)


Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
3


Fixed submission (verdict: Accepted):
N, T = map(int, input().split(" "))
t = list(map(int, input().split(" ")))

shower = 0

for i in range(0, N-1):
    if t[i+1]-t[i] >= T:
        shower += T
    else:
        shower += t[i+1]-t[i]

shower += T
print(shower)

Problem: p03731
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, T = map(int, input().split())        
t = list(map(int, input().split()))     

X = 0
Time = 0    

for i in range(N):

    if Time < t[i]:
        X += T
        Time = t[i] + T

print(X)

Failing test case input:
2 4
0 3

Expected output:
7

Actual output:
4


Fixed submission (verdict: Accepted):
N, T = map(int, input().split())
t = list(map(int, input().split()))

X = 0
Time = 0

for i in range(N):

    if Time <= t[i] :
        X += T

    else:
        X += t[i] - t[i-1]

    Time = t[i] + T

print(X)