HIRINGWO - Editorial

thanks man

No need to thanks. Now it’s your turn to debug mine :smiley:
https://www.codechef.com/viewsolution/39780259

first of all you should write a clean code, man it’s hard to read when no formatting is there and when you provide the code to debug to other please remove the template and make sure to also remove unused variable

1 Like

Thanks alot bro.This reply helped me out indirectly.
I was removing global unsed variables (to make it readable) , only then i realized that i am accidently not redeclaring vartiable ‘j’ at every recursion call. I changed and it got accepted.

1 Like

sorry man for me it’s hard to debug when I compiled you code in geany I gave me bunch of warnings. If you like I can provide the test case even though It would be ironic and I am not even good at debugging.

One more thing you give the same name to local variable which you gave to global variable make sure to avoid this.

1 Like

Sure ,will keep in mind next time.

For anyone else in need of test cases , here are two :

4
2 90
3 90
2 200
3 216

answer :
19
16
33
36

5
8 9
2 40
2 126
3 252
2 252
answer :
16
13
23
20
37

I did the same but it fails :frowning:

Invalid Test Case [For Official Problem]

1 90

2 ≤ K , X ≤ 10^6

my code gives answer 13 in this case but it is giving WA…

thanks man i was stuck for while ,now i got my mistake…:slight_smile:

Thanks. Edited.

my code passed them all and it gives WA … I think the best test case for this is 2 210

It will get accepted on the 6th day but acc. to the TC it should be accepted on 30th day.

If we use 2,2,3 it will get accepted on 6th day and acc to TC it should get accepted on 30 day thats why we take 2,3,5

Thanks for helping out with the partition brute force, can you please explain how you figured out the time complexity of the brute force solution?

The best reply. Correct LCM in end is not ensured.

Ahh made the same mistake bro

https://www.codechef.com/viewsolution/39783935
Can someone please help me in finding as to where I am wrong in my solution for yesterday’s Hiring Worker’s solution?