ZhenlongDai/ACPR huggingface dataset:
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(float, input().split())
for i in range(1, 1010):
    if int(i * 0.08) == A and int(i * 0.1) == B and int(i * 0.08) == int(i * 0.1):
        print(i)
        break
    if i == 1009:
        print("-1")



Failing test case input:
12 15

Expected output:
150


Actual output:
-1


Fixed submission (verdict: Accepted):
A, B = map(float, input().split())
for i in range(1, 1010):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()

print("-1")

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
flag = 0
a,b = map(int,input().split())
for i in range(b*10,b*10+10):
    if math.floor(i*0.08) == a:
        print(i)
        flag = 1
        break
if flag == 1:
    print(-1)

Failing test case input:
6 37

Expected output:
-1


Actual output:

Fixed submission (verdict: Accepted):
import math
flag = 0
a,b = map(int,input().split())

for i in range(1,10000):
    if int(i*0.08) == a and int(i*0.1) == b:
        print(i)
        break
    elif i*0.08 > a and i*0.1 > b:
        print(-1)
        break

Problem: p02755
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
from math import floor , ceil

num = [int(_) for _ in input().split()]

x = ceil(num[0] / (8 / 100))

y = round(num[1] / (10 / 100))

if x < y :
    print(-1)
    exit()
elif x == y:
    print(x)
else:
    for temp in range(y,x+1):
        if num[0] == floor(0.08 * temp) and num[1] == floor(0.10 * temp):
            print(temp)
            exit()
        

Failing test case input:
290 32

Expected output:
-1


Actual output:

Fixed submission (verdict: Accepted):
from math import floor , ceil

num = [int(_) for _ in input().split()]

x = ceil(num[0] / (8 / 100))
y = round(num[1] / (10 / 100))

if x == y:
    print(x)
    exit()
else:
    for temp in range(min(x,y), max(x,y)+1 ):
        if floor(temp * 0.08) == num[0] and floor(temp * 0.10) == num[1]:
            print("{}".format(temp))
            exit()
print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys


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


def main():
    A, B = map(int, input().split())
    if A / 0.08 < B / 0.1:
        print(-1)
        exit()
    for n in range(int(A / 0.08), 10 * B + 10):
        if int(n * 0.08) == A and int(n * 0.1) == B:
            print(n)
            exit()
    print(-1)


if __name__ == "__main__":
    main()


Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
import sys


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


def main():
    A, B = map(int, input().split())
    if A > B:
        print(-1)
        exit()
    for n in range(int(A / 0.08)-10, 10 * B + 10):
        if int(n * 0.08) == A and int(n * 0.1) == B:
            print(n)
            exit()
    print(-1)


if __name__ == "__main__":
    main()
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
A,B = map(int,input().split())

Idic = {}

ans = -1

for i in range(1,101):
    a = int(i*0.08)
    b = int(i*0.1)
    if a == A and b == B:
        ans = i
        break
print(ans)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
A,B = map(int,input().split())

ans = -1

for i in range(1,10001):
    a = int(i*0.08)
    b = int(i*0.1)
    if a == A and b == B:
        ans = i
        break
print(ans)

Problem: p02755
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B = map(int, input().split())
target = -1
for i in range(1300):
  if int(i*0.08) == int(i*0.1):
    target = i
print(target)

Failing test case input:
97 106

Expected output:
-1


Actual output:
39


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
target = -1
for i in range(1300):
  if int(i*0.08) == A and int(i*0.1) == B:
    target = i
    break
print(target)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split(' '))
import math
asil1_1 = (100*(A))/8
asil1_2 = (100*(A+1))/8
asil2_1 = 10*(B)
asil2_2 = 10*(B+1)

sonuc_1 = max(asil1_1, asil2_1)
sonuc_2 = min(asil2_2, asil1_2)
print(sonuc_1, sonuc_2)
if sonuc_1>=sonuc_2:
    print(-1)
else:
    print(math.ceil(sonuc_1))

Failing test case input:
3 99

Expected output:
-1


Actual output:
990 50.0
-1


Fixed submission (verdict: Accepted):
A, B = map(int, input().split(' '))


import math
asil1_1 = (100*(A))/8
asil1_2 = (100*(A+1))/8
asil2_1 = 10*(B)
asil2_2 = 10*(B+1)
sonuc_1 = max(asil1_1, asil2_1)
sonuc_2 = min(asil2_2, asil1_2)
if math.ceil(sonuc_1)>=sonuc_2:
    print(-1)
else:
    print(math.ceil(sonuc_1))

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

A, B = map(int, input().split())
value = 0
for i in range(1, 101):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        value = i
        break
if value == 0:
    print(-1)
else:
    print(value)


Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
import math

A, B = map(int, input().split())
value = 0
for i in range(1, 1001):
    if math.floor(i * 0.08) == A and math.floor(i * 0.1) == B:
        value = i
        break
if value == 0:
    print(-1)
else:
    print(value)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

a, b = list(map(int, input().split()))
result = -1
end_flag = False
for i in range(1, 101):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 101):
                y = math.floor(j * 0.1)
                if int(y) == b:
                    result = i
                    end_flag = True
                    break


print(result)


Failing test case input:
12 15

Expected output:
150


Actual output:
-1


Fixed submission (verdict: Accepted):
import math

a, b = list(map(int, input().split()))
result = -1
end_flag = False
for i in range(1, 1251):
    if not end_flag:
        x = math.floor(i * 0.08)
        if int(x) == a:
            for j in range(1, 1001):
                y = math.floor(j * 0.1)
                if i == j:
                    if int(y) == b:
                        result = i
                        end_flag = True
                        break
print(result)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a,b=map(int,input().split())
for i in range(102):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        break
    elif i==101:
        print(-1)

Failing test case input:
12 15

Expected output:
150


Actual output:
-1


Fixed submission (verdict: Accepted):
import math
a,b=map(int,input().split())
for i in range(1,1252):
    if i==1251:
        print(-1)
    elif math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        break

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
cand_b=[b*11 + i for i in range(b)]
def ans(cand):
  for price in cand:
    if int(price*0.08)==a:
      print(price)
      return
  print(-1)

ans(cand_b)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
a,b=map(int,input().split())
cand_b=[b*10 + i for i in range(10*b)]
def ans(cand):
  for price in cand:
    if int(price*0.08)==a and int(price*0.1)==b:
      print(price)
      return
  print(-1)

ans(cand_b)

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


eight, ten = list(map(int, input().split()))
for i in range(1000+5):
    if eight == int(i * 0.08) & ten == int(i * 0.1):
        print(i)
        exit()

print(-1)


Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):


eight, ten = list(map(int, input().split()))
for i in range(1000+5):
    if eight == int(i * 0.08) and ten == int(i * 0.1):
        print(i)
        exit()

print(-1)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
A, B = map(int, input().split())
 
max_val = int(math.ceil(A / 0.08))
min_val = int(math.floor(B / 0.1))
 
for i in range(min_val - 1, max_val + 1):
    if int(i * 0.08) > A or int(i * 0.1) > B:
        break
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit(0)
print(-1)

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
import math
A, B = map(int, input().split())
 
max_val = int(math.ceil(A / 0.07))
min_val = int(math.floor(B / 0.11))
 
for i in range(min_val, max_val + 1):
    if int(i * 0.08) > A or int(i * 0.1) > B:
        break
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit(0)
print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=map(int,input().split())
print(a,b)

for i in range(1,1250):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        break
else:
    print(-1)

Failing test case input:
134 34

Expected output:
-1


Actual output:
134 34
-1


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

for i in range(1,1250):
    if int(i*0.08)==a and int(i*0.1)==b:
        print(i)
        break
else:
    print(-1)

Problem: p02755
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A, B = map(int, input().split())
l = []
for i in range(1, 10000):
  a = i * 0.08
  b = i * 0.1
  if a > A and b > B:
    break
  elif a <= A and B <= b:
    l.append(i)

  
if len(l) == 0:
  print(-1)
else:
  print(max(l))

Failing test case input:
210 32

Expected output:
-1


Actual output:
2625


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
l = []
for i in range(1, 10000):
  a = i * 0.08
  b = i * 0.1
  if a > A+1 and b > B+1:
    break
  elif A <= a < A+1 and B <= b < B+1:
    l.append(i)

if len(l) == 0:
  print(-1)
else:
  print(min(l))

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input().split(" ")
t8 = int(a[0])
t10 = int(a[1])
b = t8 / 0.08
if int(b * 0.1) == t10:
	print(int(b))
elif int(b + 0.8) == int(b):
	b += 0.8
	if int(b * 0.1) == t10:
		print(int(b * 0.1))
else:
	print(-1)



Failing test case input:
146 32

Expected output:
-1


Actual output:

Fixed submission (verdict: Accepted):
a = input().split(" ")
t8 = int(a[0])
t10 = int(a[1])

for i in range(13, 1001):
	b = int(i * 0.08)
	c = int(i * 0.1)
	if b == t8 and c == t10:
		print(i)
		break
	if i == 1000:
		print(-1)
		break
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
S = [int(x) for x in input().split()]
A = S[0]
B = S[1]
ans = -1

for i in range(100):
    num = (i+1)
    MotoA = int(num * 0.08)
    MotoB = int(num * 0.1)
    if MotoA == A and MotoB ==B:
        ans = num
        break

print(ans)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
S = [int(x) for x in input().split()]
A = S[0]
B = S[1]
ans = -1

for i in range(1000):
    num = (i+1)
    MotoA = int(num * 0.08)
    MotoB = int(num * 0.1)
    if MotoA == A and MotoB ==B:
        ans = num
        break

print(ans)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())

minA = A / 0.08
maxA = (A+1) / 0.08
minB = B / 0.1
maxB = (B+1) / 0.1

print(minA, maxA, minB, maxB)

if minB <= minA and minA < maxB: print(int(minA))
elif minA <= minB and minB < maxA: print(int(minB))
elif minB < maxA and maxA < maxB: print(int(maxA)-1)
elif minA < maxB and maxB < maxA: print(int(maxB)-1)
else: print("-1")

Failing test case input:
8 -3

Expected output:
-1


Actual output:
100.0 112.5 -30.0 -20.0
-1


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())

minA = A / 0.08
maxA = (A+1) / 0.08
minB = B / 0.1
maxB = (B+1) / 0.1

if minB <= minA and minA < maxB: print(int(minA) + (1 if minA > int(minA) else 0))
elif minA <= minB and minB < maxA: print(int(minB) + (1 if minB > int(minB) else 0))
else: print("-1")

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int,input().split())

if A == 0 and B == 0:
    print(0)
    exit()

for i in range(100):
    a = int((i+1)*0.08)
    b = int((i+1)*0.1)
    if A == a and B == b:
        print(i+1)
        exit()

print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
import math

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

if A == 0 and B == 0:
    print(0)
    exit()

for i in range(1000):
    a = math.floor((i+1)*8/100)
    b = math.floor((i+1)/10)
    if A == a and B == b:
        print(i+1)
        exit()

print(-1)

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

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




_max = int(A / 0.08)
_min = int(B / 0.1)


for ans in range(_min-1, _max+2):
    if (int(ans * 0.08) == A and int(ans * 0.1) == B):
        print(ans)
        exit()
print(-1)

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):

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








for ans in range(1, 1010):
    if (int(ans * 0.08) == A and int(ans * 0.1) == B):
        print(ans)
        exit()
print(-1)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
amin = (a*10**2)
amax = amin + 8
bmin = (b*10**2)
bmax = bmin + 10
for i in range(amin, amax):
    for j in range(bmin, bmax):
        if i == j:
            print(i)
            exit()
print(-1)


Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
amin = -(-a*25
amax = -(-(a+1)*25
bmin = b*10
bmax = bmin + 10
for i in range(amin, amax):
    for j in range(bmin, bmax):
        if i == j:
            print(i)
            exit()
print(-1)

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

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

for i in range(1, 101):
  if(math.floor(i*0.08) == A and math.floor(i*0.10) == B and flag == True):
    print(i)
    flag=False

if(flag==True):
  print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
import math

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

for i in range(1, 2000):
  if(math.floor(i*0.08) == A and math.floor(i*0.10) == B and flag == True):
    print(i)
    flag=False

if(flag==True):
  print(-1)

Problem: p02755
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
A_tax, B_tax = map(int,input().split())

for i in range(100):
    for j in range(10):
        if (A_tax+i*0.01)/0.08 == (B_tax+j*0.1)/0.1:
            print(int((A_tax+i)/0.08))
            exit()
print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
625


Fixed submission (verdict: Accepted):
from math import floor
A_tax, B_tax = map(int,input().split())

for i in range(1,1001):
    if floor(i*0.08) == A_tax and floor(i*0.1) == B_tax:
        print(i)
        exit()

print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())

for i in range(101):
    if A==int(i*8/100) and B==int(i*10/100):
        print(i)
        exit()

print(-1)

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())

for i in range(1, 1001):
    if A==int(i*8/100) and B==int(i*10/100):
        print(i)
        exit()

print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a,b = map(int,input().split())
ans = -1
for i in range(101):
    A = 0.08*i
    B = 0.1*i
    if math.floor(A) == a and math.floor(B) == b:
        ans = i
        break
print(ans)

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
import math
a,b = map(int,input().split())
ans = -1
for i in range(10**4):
    A = 0.08*i
    B = 0.1*i
    if math.floor(A) == a and math.floor(B) == b:
        ans = i
        break
print(ans)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
for i in range(1, 101):
    if int(i*1.08) == A and int(i*1.1) == B:
        print(i)
        break
else:
    print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
A, B = map(int, input().split())
for i in range(1, 10001):
    if int(i*0.08) == A and int(i*0.1) == B:
        print(i)
        break
else:
    print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a,b=list(map(float,input().split()))
import sys
for i in range(100000):
  if int(i*8/100)==a and int(i*8/100):
    print(i)
    sys.exit()
print(-1)

  

Failing test case input:
97 106

Expected output:
-1


Actual output:
1213


Fixed submission (verdict: Accepted):
a,b=list(map(float,input().split()))
import sys
for i in range(100000):
  if int(i*8/100)==a and int(i*10/100)==b:
    print(i)
    sys.exit()
print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
A,B=map(int,input().split())
d=(B*10)-4
for i in range(d,d+18):
  if int(i*0.08)==A:
    print(i)
    sys.exit()
print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
126


Fixed submission (verdict: Accepted):
import sys
A,B=map(int,input().split())
for i in range(1010):
  if int(i*0.1)==B and int(i*0.08)==A:
    print(i)
    sys.exit()
print(-1)

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

a,b = map(int, input().split())
t = 1
x = False
y = False
z = False

while t <= 10000:
    c = math.floor(t * 0.08)
    
    if c == a:
        x = True
    else:
        x = False
        
    if c == b:
        y = True
    else:
        y = False
        
    if x and y:
        print(t)
        z = True
        break
        
    t = t + 1

if z == False:
    print('-1')

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
import math

a,b = map(int, input().split())
t = 1
x = False
y = False
z = False

while t <= 10000:
    c = math.floor(t * 0.08)
    d = math.floor(t * 0.1)
    
    if c == a:
        x = True
    else:
        x = False
        
    if d == b:
        y = True
    else:
        y = False
        
    if x and y:
        print(t)
        z = True
        break
        
    t = t + 1

if z == False:
    print('-1')

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B=map(int,input().split())

for i in range(1,101):
  if int(i*0.08)==A and int(i*0.1)==B:
    print(i)
    exit(0)
else:
  print(-1)

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
A,B=map(int,input().split())

for i in range(1,10101):
  if int(i*0.08)==A and int(i*0.1)==B:
    print(i)
    exit(0)
else:
  print(-1)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())













for i in range(1, 101, 1):
    
    x = i * 0.08
    x_2 = int(x)
    y = i * 0.1
    y_2 = int(y)
    
    
    if x_2 == a and y_2 == b:
        
    
        ans = i
        break
    else:
        ans = -1

print(ans)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


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
















for i in range(1, 1009, 1):
    
    x = i * 0.08
    
    x_2 = int(x)
    y = i * 0.1
    
    y_2 = int(y)
    
    
    if x_2 == a and y_2 == b:
        
    
        ans = i
        break
    else:
        ans = -1

print(ans)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A, B = map(int, input().split())
for i in range(1,1001):
    Ahan = int(i * 0.08)
    Bhan = int(i * 0.10)
    if (Ahan == A and Bhan == B):
        print(i)
        break
print('-1')

Failing test case input:
12 15

Expected output:
150


Actual output:
150
-1


Fixed submission (verdict: Accepted):
A,B = (int(x) for x in input().split())
for i in range(1,1001):
    Ahan = int(i * 0.08)
    Bhan = int(i * 0.10)
    if (Ahan == A and Bhan == B):
        print(i)
        exit()
print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
A,B = [int(i) for i in input().split()]
for j in range(1,101):
    i = float(j)
    if int(i*0.08)==A and int(i*0.1)==B:
        print(int(i));exit()
print(-1)


Failing test case input:
12 15

Expected output:
150


Actual output:
-1


Fixed submission (verdict: Accepted):
A,B = [int(i) for i in input().split()]
for i in range(1,10000):
    if int(i*0.08)==A and int(i*0.1)==B:
        print(i);exit()
print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a, b = map(int, input().split())
count = 0
ans = 0
for i in range(1, 101):
    if int(i*0.08) == a and int(i*0.1) == b:
        count = 1
        ans = i
        break
    else:
        pass
print(ans if count == 1 else "-1")

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
a, b = map(int, input().split())
count = 0
ans = 0
for i in range(1, 1001):
    if int(i*0.08) == a and int(i*0.1) == b:
        count = 1
        ans = i
        break
    else:
        pass
print(ans if count == 1 else "-1")
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

pricemax_A = math.floor((A+1)/0.08)
pricemin_A = math.floor(A/0.08)

pricemax_B = math.floor((B+1)/0.1)
pricemin_B = math.floor(B/0.1)

if pricemin_A >= pricemin_B and pricemin_A < pricemax_B:
    print(pricemin_A)
else:
    print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
import math

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

pricemax_A = math.floor((A+1)/0.08)
pricemin_A = math.ceil(A/0.08)

pricemax_B = math.floor((B+1)/0.1)
pricemin_B = math.ceil(B/0.1)

if pricemin_A >= pricemin_B and pricemin_A < pricemax_B:
    print(pricemin_A)
elif pricemin_A <= pricemin_B and pricemax_A > pricemin_B:
    print(pricemin_B)
else:
    print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
a,b = map(int, input().split())

n = a / 0.08
m = b / 0.1



if n == m:
    print(int(n))
    exit()

s = math.floor(n*0.08)
t = math.floor(n*0.1)

if s == t:
    print(int(n))
else:
    print(-1)


Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
import math
a,b = map(int, input().split())

for i in range(1010):
    s = math.floor(i*0.08)
    t = math.floor(i*0.10)
    if s == a and t == b:
            print(i)
            break
else:
    print(-1)

Problem: p02755
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import math
A,B=map(int,input().split())
sup=min((A+1)/1.08,(B+1)/1.1)
inf=max(A/1.08,B/1.1)
inf2=math.ceil(inf)
if inf2<sup:
  print(inf2)
else:
  print(-1)

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):
import math
A,B=map(int,input().split())
sup=min((A+1)/0.08,(B+1)/0.1)
inf=max(A/0.08,B/0.1)
inf2=math.ceil(inf)
if inf2<sup:
  print(inf2)
else:
  print(-1)

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

a,b = map(int,input().split())
import math
c=10000
for i in range(101):
    if math.floor(i*0.08)==a and math.floor(i*0.10)==b:
        c = min(c,i)
if c==10000:
    print(-1)
    exit()
print(c)   

Failing test case input:
10 13

Expected output:
130


Actual output:
-1


Fixed submission (verdict: Accepted):

a,b = map(int,input().split())
import math
c=10000
for i in range(1200):
    if math.floor(i*0.08)==a and math.floor(i*0.10)==b:
        c = min(c,i)
if c==10000:
    print(-1)
    exit()
print(c)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
cuts = []
for i in range(2000):
  cuts+= [[i*0.08, i*0.10]]
  
A, B = map(int,input().split())

for i in range(2000):
  if [A, B] == cuts[i]:
    print(i)
    break

Failing test case input:
134 157

Expected output:
-1


Actual output:

Fixed submission (verdict: Accepted):
cuts = []
for i in range(2000):
  cuts+= [[int(i*0.08), int(i*0.10)]]
  
A, B = map(int,input().split())

for i in range(1,2000):
  if [A, B] == cuts[i]:
    print(i)
    break
else:
  print(-1)
Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
s = input().split()
A = int(s[0])
B = int(s[1])

A_price_low = A / 0.08
B_price_low = B / 0.1
A_price_high = (A+1) / 0.08
B_price_high = (B+1) / 0.1

if B_price_low <= A_price_low < B_price_high:
    if A_price_low % 2 == 0:
        print(int(A_price_low))
    else:
        print(int(A_price_low) + 1)
else:
    print(-1)


Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
s = input().split()
A = int(s[0])
B = int(s[1])

A_price_low = A / 0.08
B_price_low = B / 0.1
A_price_high = (A+1) / 0.08
B_price_high = (B+1) / 0.1

if B_price_low <= A_price_low < B_price_high:
    if A % 2 == 0:
        print(int(A_price_low))
    else:
        print(int(A_price_low) + 1)
elif A_price_low <= B_price_low < A_price_high:
    print(int(B_price_low))
else:
    print(-1)

Problem: p02755
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import ceil, floor

A, B = map(int, input().split())
for i in range(100):
    j = i+1
    if floor(j*0.08) ==A and floor(j*0.1)==B:
        print(j)
        break
else:
    print("-1")

Failing test case input:
12 15

Expected output:
150


Actual output:
-1


Fixed submission (verdict: Accepted):
from math import ceil, floor

A, B = map(int, input().split())
for i in range(10000):
    j = i+1
    if floor(j*0.08) ==A and floor(j*0.1)==B:
        print(j)
        break
else:
    print(-1)

Problem: p02755
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a, b = map(int,input().split())

cnt = 0

for i in range(1,1010):
    A = 0.08 * a
    B = 0.1 * b
    if int(A) == int(B):
        print(int(A))
        cnt += 1
        break
if cnt == 0:
    print(-1)
    

Failing test case input:
12 16

Expected output:
160


Actual output:
-1


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

cnt = 0

for i in range(1,1010):
    A = int(i * 8 
    B = int(i * 10 
    if (A == a) and (B == b):
        print(i)
        cnt += 1
        break

if cnt == 0:
    print(-1)

Problem: p02755
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
a, b = [int(i) for i in input().split()]
A = a/0.08
B = b*10

if B-10 < A < B+10:
    print(int(max(A, B)+0.5))
else:
    print(-1)



Failing test case input:
12 16

Expected output:
160


Actual output:
-1


Fixed submission (verdict: Accepted):
a, b = [int(i) for i in input().split()]
A = a/0.08
B = b*10
if B-10 <= A < B+10:
    print(int(max(A, B)+0.5))
else:
    print(-1)
Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, C, K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()
answer = 1
while len(T) >0:
    limit = T[0] + K
    counter = 0
    while counter <= C:
        if len(T) == 0:
            break
        t = T.pop(0)
        if t > limit:
            break
        counter += 1
    answer += 1
print(answer)

Failing test case input:
6 3 6
7
9
4
28
19
5

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
N, C, K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()
answer = 0
while len(T) > 0:
    limit = T[0] + K
    counter = 0
    while counter < C:
        if len(T) == 0:
            break
        if T[0] > limit:
            break
        del T[0]
        counter += 1
    answer += 1
print(answer)

Problem: p03785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()

ans=0
i=0
j=1
tmp=1
while True:
    
    if j-i==C:
        if j==N:
            ans+=1
            break
        ans+=1
        i=j
        j=i+1
        tmp=1
    if j>=N:
        ans+=1
        break
    if i!=N-1:
        if T[j]-T[i]>K:
            ans+=1
            i=j
            j=i+1
            tmp=1
            continue
        else:
            j+=1
            tmp+=1
print(ans)

Failing test case input:
6 1 3
7
6
2
13
17
5

Expected output:
6


Actual output:
4


Fixed submission (verdict: Accepted):
N,C,K=map(int,input().split())
T=[int(input()) for _ in range(N)]
T.sort()

if C==1:
    print(N)
    exit()
ans=0
i=0
j=1
tmp=1
while True:
    
    if j-i==C:
        if j==N:
            ans+=1
            break
        ans+=1
        i=j
        j=i+1
        tmp=1
    if j>=N:
        ans+=1
        break
    if i!=N-1:
        if T[j]-T[i]>K:
            ans+=1
            i=j
            j=i+1
            tmp=1
            continue
        else:
            j+=1
            tmp+=1
print(ans)

Problem: p03785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,c,k=map(int,input().split())
t=[int(input()) for i in range(n)]
t.sort()

ans=1
x=t[0]
y=0
for i in range(n-1):
    y+=1
    if t[i]-x>k:
        ans+=1
        x=t[i]
        y=0
    elif y==c:
        ans+=1
        x=t[i+1]
        y=0

print(ans+1 if t[-1]-x>k else ans)

Failing test case input:
6 3 3
7
0
2
8
7
6

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n,c,k=map(int,input().split())
t=[int(input()) for i in range(n)]
t.sort()
ans=0
x=t[0]
y=0
for i in range(n-1):
    y+=1
    if t[i]-x>k:
        ans+=1
        x=t[i]
        y=1
    elif y==c:
        ans+=1
        x=t[i+1]
        y=0
print(ans+2 if t[-1]-x>k else ans+1)
Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
nums ,limit ,wait = map(int, input().split())
nums_ary = [0 for i in range(nums)]
nums_ary.append(10000000000)
time = 0
count = 0
a = -1

for i in range(nums):
    nums_ary[i] = int(input())

nums_ary.sort()

while a < nums :
    a += 1
    time = nums_ary[a]
    b = 0
    while a < nums and b < limit-1:
        if not time <= nums_ary[a] < time+wait:
            count += 1
            break
        a += 1
        b += 1
    else:
        count += 1
print(count)

Failing test case input:
6 3 3
7
6
2
13
17
5

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
nums ,limit ,wait = map(int, input().split())
nums_ary = [0 for i in range(nums)]

for i in range(nums):
    nums_ary[i] = int(input())

nums_ary.sort()
nums_ary.append(10000000000000)
count = 0
i = 0
while i < nums:
    time = nums_ary[i]
    for x in range(limit):
        if not time <= nums_ary[i] <= time + wait:
            count += 1
            break
        i += 1
    else:
        count += 1
print(count)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, c, k = map(int, input().split())
T = sorted([int(input()) for _ in range(n)])

peo = 1
bus = 1
out = T[0] + k

for t in T:
    if t <= out and peo < c:
        peo += 1
    else:
        out = t + k
        peo = 1
        bus += 1

print(bus)

Failing test case input:
6 2 3
7
0
2
8
7
6

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N,C,K = map(int,input().split())
T = [int(input()) for _ in range(N)]
T.sort()
time = T.pop(0)
people = 1
ans = 1
for t in T:
    if t <= time + K and people < C:
        people += 1
    else:
        time = t
        people = 1
        ans += 1
print(ans)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, c, k = map(int, input().split())
times = sorted([int(input()) for _ in range(n)])

count = 0
passengers = 0
border = 0
for i in range(n):
    if border == 0:
        border = times[i] + k
    if c > passengers and border >= times[i]:
        passengers += 1
        if passengers == c:
            count += 1
            passengers = 0
            border = 0
    elif border < times[i]:
        count += 1
        passengers += 1
        border = 0

print(count + 1 if passengers > 0 else count)

Failing test case input:
6 3 3
7
6
2
21
10
5

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
n, c, k = map(int, input().split())
times = sorted([int(input()) for _ in range(n)])

count = 0
passengers = 0
border = 0
for i in range(n):
    if border == 0:
        border = times[i] + k
    if c > passengers and border >= times[i]:
        passengers += 1
        if passengers == c:
            count += 1
            passengers = 0
            border = 0
    elif border < times[i]:
        count += 1
        passengers = 1
        border = times[i] + k

print(count + 1 if passengers > 0 else count)
Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, C, K = map(int, input().split())
T = [int(input()) for _ in range(N)]

T.sort()

cnt = 1
p = 0

for i in range(N-1):
    if T[i+1]-T[i] > K:
        cnt += 1
        p = 0
    else:
        p += 1
        if p == C:
            p = 0
            cnt += 1
            
print(cnt)

Failing test case input:
5 10 5
1
4
3
7
12

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
N, C, K = map(int, input().split())
T = [int(input()) for _ in range(N)]

T.sort()

cur = T[0]
p = 0
cnt = 1

for t in T:
    p += 1
    if t > cur + K or p > C:
        cur = t
        p = 1
        cnt += 1
        
print(cnt)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, c, k = map(int, readline().split())
t = sorted([int(readline()) for i in range(n)])
cnt = 1
ans = 1
time = t[0] + k
for i in range(n):
    if cnt >= c or time < t[i]:
        ans += 1
        cnt = 0
        time = t[i] + k
    cnt += 1
print(ans)


Failing test case input:
5 3 5
1
7
3
6
12

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, c, k = map(int, readline().split())
t = sorted([int(readline()) for i in range(n)])
cnt = 0
ans = 1
time = t[0] + k
for i in range(n):
    if cnt >= c or time < t[i]:
        ans += 1
        cnt = 0
        time = t[i] + k
    cnt += 1
print(ans)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N,C,K=map(int,input().split())
A=[]
for i in range(N):
    a=int(input())
    A.append(a)
A.sort()
k=K
a=0
n=N
j=1
while j<N:
    k-=A[j]-A[j-1]
    n-=1
    if k>0 and n>0:    
        j+=1
        if j==N:
            a+=1
    else:     
        a+=1
        n=N
        k=K
        j+=1
        if j==N:
            a+=1
print(a)   

Failing test case input:
5 3 5
1
4
3
7
12

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N,C,K=map(int,input().split())
A=[]
for i in range(N):
    a=int(input())
    A.append(a)
A.sort()
k=K
a=0
c=C-1
j=1
while j<N:
    k-=A[j]-A[j-1]
    c-=1
    if k>=0 and c>=0:    
        j+=1
    else:     
        a+=1
        c=C-1
        k=K
        j+=1
print(a+1)
Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, c, k = map(int, input().split())
t_list = [int(input()) for i in range(n)]

t_sorted = sorted(t_list)

ans = 1
bus = 0
timer = 0
for i in range(1, len(t_sorted)):
    bus += 1
    timer += t_sorted[i] - t_sorted[i - 1]
    if bus >= c or timer >= k:
        ans += 1
        bus = 1
        timer = 0

print(ans)

Failing test case input:
6 4 3
11
9
2
13
17
5

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
n, c, k = map(int, input().split())
t_list = [int(input()) for i in range(n)]

t_sorted = sorted(t_list)

ans = 1
bus = 1
timer = 0
for i in range(1, len(t_sorted)):
    bus += 1
    timer += t_sorted[i] - t_sorted[i - 1]
    if bus > c or timer > k:
        ans += 1
        bus = 1
        timer = 0

print(ans)

Problem: p03785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n, c, k = map(int, input().split())
    t = [int(input()) for _ in range(n)]
    t.sort()
    ans = 0
    passengers = 0
    first = t[0]
    for tn in t:
        if tn > first + k:
            ans += 1
            passengers = 0
        if passengers == 0:
            first = tn
        passengers += 1
        if passengers == c:
            ans += 1
            passengers = 0
    if passengers:
        ans += 1

    print(ans)


if __name__ == '__main__':
    main()


Failing test case input:
6 3 3
7
6
2
14
10
6

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
def main():
    n, c, k = map(int, input().split())
    t = [int(input()) for _ in range(n)]
    t.sort()
    ans = 0
    passengers = 0
    first = t[0]
    for tn in t:
        if tn > first + k or passengers == c:
            ans += 1
            passengers = 0
            first = tn
        passengers += 1

    print(ans + 1)


if __name__ == '__main__':
    main()

Problem: p03785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    n, c, k = map(int, input().split())
    t = [int(input()) for i in range(n)]
    t.sort()

    ans = 0
    tt = t[0]
    cc = 1
    for i in range(1, n):
        if tt + k > t[i] or cc == c:
            tt = t[i]
            ans += 1
            cc = 1
        else:
            cc += 1
    print(ans)


if __name__ == '__main__':
    main()

Failing test case input:
5 10 5
1
4
3
6
12

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
def main():
    n, c, k = map(int, input().split())
    t = [int(input()) for i in range(n)]
    t.sort()

    ans = 0
    tt = t[0]
    cc = 1
    for i in range(1, n):
        if tt + k < t[i] or c == cc:
            tt = t[i]
            ans += 1
            cc = 1
        else:
            cc += 1

    print(ans+1)


if __name__ == '__main__':
    main()
Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, C, K = map(int,input().split())
T = sorted([int(input()) for _ in range(N)])
ans, cnt = 0, 0
st = T[0]
for i in range(N):
  if T[i] <= st + K:
    cnt += 1
    if cnt == C:
      ans += 1
      st = T[min(i+1,N-1)]
  else:
    ans += 1
    cnt = 0
    st = T[i]
print(ans+1)

Failing test case input:
6 2 3
7
0
2
8
7
6

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N, C, K = map(int,input().split())
T = sorted([int(input()) for _ in range(N)])
ans, cnt = 0, 0
st = T[0]
for i in range(N):
  if T[i] > st + K or cnt == C:
    ans += 1
    cnt = 1
    st = T[i]
  else:
    cnt += 1
print(ans+1)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
def input():
    return sys.stdin.readline()[:-1]
N,C,K=map(int,input().split())
T=[int(input()) for i in range(N)]
T.sort()
t=T[0]+K
a=1
h=1
for i in T:
    if t>i and h<C:
        h+=1
    else:
        t=i+K
        h=1
        a+=1
print(a)

Failing test case input:
6 3 0
7
6
2
22
10
6

Expected output:
5


Actual output:
7


Fixed submission (verdict: Accepted):
import sys
def input():
    return sys.stdin.readline()[:-1]
N,C,K=map(int,input().split())
T=[int(input()) for i in range(N)]
T.sort()
t=T[0]+K
a=1
h=1
for i in T[1:]:
    if t>=i and h<C:
        h+=1
    else:
        t=i+K
        h=1
        a+=1
print(a)

Problem: p03785
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n,c,k = map(int,input().split())
ab = []
for _ in range(n):
    t=int(input())
    ab.append(t)
ab.sort()

bus = 1
customer = 1

for i in range(1,n):
    if customer < c and ab[i] <= ab[i-1] + c:
        customer += 1
        if customer == c:
            customer = 0
            bus += 1
    elif ab[i-1] + c < ab[i]:
        customer = 1
        bus += 1
print(bus)

Failing test case input:
6 6 0
7
9
8
9
19
5

Expected output:
5


Actual output:
2


Fixed submission (verdict: Accepted):
n,c,k = map(int,input().split())
ab = []
for _ in range(n):
    t=int(input())
    ab.append(t)
ab.sort()

bus = 1
bustime = ab[0] + k
customer = 1

for i in range(1,n):
    if customer < c and ab[i] <= bustime:
        customer += 1
    else:
        bustime = ab[i]+k
        customer = 1
        bus += 1
print(bus)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, c, k = map(int, input().split())

lt = list()
for i in range(n):
    lt.append(int(input()))
lt.sort()

b = 1  
p = 0  
m = lt[0]

for i in range(n):
    if p < c-1 and lt[i]-m < k:
        p += 1
    else:
        p = 0
        b += 1
        m = lt[i]

print(b)

Failing test case input:
5 5 5
1
1
3
6
12

Expected output:
2


Actual output:
3


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

lt = list()
for i in range(n):
    lt.append(int(input()))
lt.sort()

b = 1  
p = 0  
m = lt[0]

for i in range(n):
    if p < c and lt[i]-m <= k:
        p += 1
    else:
        p = 1
        b += 1
        m = lt[i]

print(b)
Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,c,k = na()
t = []

for i in range(n):
    u = ni()
    t.append(u)

t.sort()

now = t[0]
p = 0
ans = 1

for i in t:
    if i-now > k or p > c:
        p = 1
        now = i
        ans += 1
    else:
        p += 1

print(ans)

Failing test case input:
4 3 10
1
7
3
6
12

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,c,k = na()
t = []

for i in range(n):
    u = ni()
    t.append(u)

t.sort()

now = t[0]
p = 1
ans = 1

for i in t:
    if i-now > k or p > c:
        p = 2
        now = i
        ans += 1
    else:
        p += 1

print(ans)

Problem: p03785
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N, C, K=map(int, input().split())
X=[]
for _ in range(N):
  X.append(int(input()))
X.sort()
X.append(10**19)
ans=0
tamatta=0
hayaihito=X[0]
for i in range(N):
  if tamatta<C and hayaihito+K>=X[i+1]:
    tamatta+=1
  else:
    tamatta=0
    hayaihito=X[i+1]
    ans+=1
print(ans)

Failing test case input:
6 3 6
7
6
2
13
15
6

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
N, C, K=map(int, input().split())
X=[]
for _ in range(N):
  X.append(int(input()))
X.sort()
X.append(10**19)
ans=0
tamatta=0
hayaihito=X[0]
for i in range(N+1):
  if tamatta<C and hayaihito+K>=X[i]:
    tamatta+=1
  else:
    ans+=1
    tamatta=1
    hayaihito=X[i]
    
print(ans)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

n,c,k = iim()
time = []
for _ in range(n):
    time.append(ii())

time.sort()

bus = 0
fst = -1
ans = 0
for item in time:
    if fst == -1:
        fst = item
    if bus <= c-1 and item-fst <= k:
        bus += 1
    elif bus > c-1:
        bus = 0
        ans += 1
        fst = item
    elif item-fst > k:
        bus = 1
        ans += 1
        fst = item
    

print(ans if bus == 0 else ans+1)

Failing test case input:
6 1 3
7
6
2
13
17
5

Expected output:
6


Actual output:
4


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

n,c,k = iim()
time = []
for _ in range(n):
    time.append(ii())

time.sort()

bus = 0
fst = time[0]
ans = 0
for item in time:
    if bus <= c-1 and item <= k+fst:
        bus += 1
    elif bus > c-1:
        bus = 1
        ans += 1
        fst = item
    elif item-fst > k:
        bus = 1
        ans += 1
        fst = item
    

print(ans if bus == 0 else ans+1)
Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from sys import stdin

n,c,k = [int(x) for x in stdin.readline().rstrip().split()]
li = [int(stdin.readline().rstrip()) for _ in range(n)]+[10**10]
li.sort()
bus = 0
time = li[0]
point = 0
for i in li:
    if i-time > c or point > c:
        bus += 1
        time = i
        point = 0
    point += 1
print(bus)

Failing test case input:
6 3 6
4
0
2
22
10
6

Expected output:
3


Actual output:
4


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

n,c,k = [int(x) for x in stdin.readline().rstrip().split()]
li = [int(stdin.readline().rstrip()) for _ in range(n)]
li.sort()
time = li[0]
people = 0
bus_num = 1

for i in li:
    people += 1
    if i-time > k or people > c:
        bus_num += 1
        time = i
        people = 1
print(bus_num)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n, c, k = map(int, input().split())
t = sorted([int(input()) for _ in range(n)])[::-1]
T = sum(t)

cnt = 0
l = 0
while l < n:
    b = 0
    r = l
    while b < c and r < n:
        if t[r] - t[l] <= k:
            b += 1
            r += 1
        if r == n:
            cnt += 1
    l = r + 1
    cnt += 1
print(cnt)

Failing test case input:
6 8 3
11
9
2
9
17
5

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n, c, k = map(int, input().split())
t = sorted([int(input()) for _ in range(n)])
T = sum(t)

cnt = 0
l, r = 0, 0
while l < n:
    b = 0
    while r < n and b + 1 <= c and t[r] - t[l] <= k:
        b += 1
        r += 1
    l = r
    cnt += 1
print(cnt)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, C, K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()

Bcnt = 0
while True:
    if len(T) <= 0:
        break
    BS = T[0] + K - 0.1
    Bcnt += 1
    del T[0]
    cnt = 1
    while cnt < 3 and len(T) > 0:
        if T[0] <= BS:
            del T[0]
            cnt += 1
        else:
            break
print(Bcnt)


Failing test case input:
5 10 5
1
4
3
2
12

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
N, C, K = map(int, input().split())
T = [int(input()) for i in range(N)]
T.sort()

Bcnt = 0
while True:
    if len(T) <= 0:
        break
    BS = T[0] + K
    Bcnt += 1
    del T[0]
    cnt = 1
    while cnt < C and len(T) > 0:
        if T[0] <= BS:
            del T[0]
            cnt += 1
        else:
            break
print(Bcnt)

Problem: p03785
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n,c,k = map(int,input().split())
a = sorted([int(input()) for i in range(n)])

s = 1
p = 1
w = a[0]+k 
for t in a[1:]:
  if p == c or t > w:
    p = 0
    s += 1
    w = t+k
  else:
    p += 1
print(s)  

Failing test case input:
6 3 3
7
0
2
8
7
6

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n,c,k = map(int,input().split())
a = sorted([int(input()) for i in range(n)])



s = 1
p = 1
w = a[0]+k 
for t in a[1:]:
  if p == c or t > w:
    p = 1
    s += 1
    w = t+k
  else:
    p += 1
print(s)