Error in vaccine problem plz help

i was solving this problem in python 3.6

https://www.codechef.com/problems/VACCINE2

I used my own scenarios too and i got the correct solution according to the question but still I am getting an error for some reason i dont know why please help

this is my code

import math
t=int(input())

for p in range(t):
n = list(map(int, input().split()))
l = list(map(int, input().split()))
D = n[1]
R = []
NR = []
for i in l:
if i>=80 or i<=9:
R.append(i)
else:
NR.append(i)
x=len®
z=len(NR)
if x/D==0:
x=1
else:
x=math.ceil(x/D)
if z/D==0:
z=1
else:
z=math.ceil(z/D)

print(z+x)

check for this input
1
1 11
10
your O/P:- 2
Correct O/P :- 1
You are doing

and

but what if z is 0 or x is 0 then also they will have 1 values in it . so that’s where you are wrong

See your code with some changes give AC :- https://www.codechef.com/viewsolution/40486331

1 Like

thank you soo much you really helped me a lot

1 Like

I really need some guidance on my journey to competitve coding I just want these kinds of help where some one can tell me whats wrong with my program it would really mean a lot is there a way i can contact you?

Just ping your question here in discuss forum if you have any doubt and can’t find on google :slight_smile:
Anyone in comunnity will help you !!

1 Like