Please subscribe to the official Codeforces channel in Telegram via the link: ×


By AJAYHAYAGREEVE, history, 12 months ago, In English,

hi guys, Am trying to solve this problem ( My approach is find the lcm of w1 and w2. Now on reaching lcm(w1, w2) if(lcm/w1*h1 > lcm/w2*h2) then we prefer h1 upto the lcm. else we prefer h2 Now for the remaining i.e from c/lcm to c, Just iterate and check which is the optimal answer. My code is . But i get wrong answer on test 3. I couldnot figure out what is wrong. Could you help me.


12 months ago, # |
  Vote: I like it 0 Vote: I do not like it

IRRELEVANT, but are you from CEG?