Stuck in a problem HELP

Revision en2, by Ludwig_Bonaparte, 2026-10-17 22:54:46

I've spent some time thinking about this problem, and for the first time of solving many questions i don't get the question itself. I somehow get the basic mechanics of this problem. But i don't know what to solve? what the question is aksing me. this is the question linkMashmokh & Tokens. I looked up at the editorial but then there's magically an assumption of k initial tokens, my thought was if i am given x tokens a day and there's some conversion for it in dollars the greedy approach would be to sell all the tokens to maximize profit, what's wrong with my thinking? ciao

This is my code btw.

#Codeforces 415-B {Mashmokh & Tokens}
n,a,b=map(int, input().split())
x=list(map(int, input().split()))
k=[]
for xi in x:
    k.append(xi*a//b)

#print(k)

for i in range(n):
    g=(k[i]*(b))//a 
    
    print(x[i]-g,end=" ")

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Ludwig_Bonaparte 2026-10-17 22:54:46 287
en1 English Ludwig_Bonaparte 2026-10-17 22:17:18 650 Initial revision (published)