12775 - Gift Dilemma

All about problems in Volume 127. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
Repon kumar Roy
Learning poster
Posts: 96
Joined: Tue Apr 23, 2013 12:54 pm

Re: 12775 - Gift Dilemma

Post by Repon kumar Roy »

Getting WA :evil:

My Algorithm is :
1. As C >=200 , I iterate a loop to take
for( int take = 0; take * C <=P ; take ++)
2. I get pp = P - C * take , which give me a linear equation of a ,b ....
ax + by = pp
3.Solving the linear Diaphantine Equation , I determine a range for the values for which x , y >= 0 , added the range to counter variable
4. Output ?

Is there anything I am missing..
Post Reply

Return to “Volume 127 (12700-12799)”