death_bringer's blog

By death_bringer, history, 8 months ago, In English

This is the problem of cses coin piles. I wanted to know can this problem be generalized? like for removing p coins from left pile and q coins from right pile and vice versa.

I tried doing it but wasn't able to figure it out. And didn't even know how to check if the solution is correct or not.

  • Vote: I like it
  • -5
  • Vote: I do not like it

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by death_bringer (previous revision, new revision, compare).

»
8 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by death_bringer (previous revision, new revision, compare).

»
8 months ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

You need to solve equation: $$$a = l \cdot p + r \cdot q$$$ and $$$b = l \cdot q + r \cdot p$$$ where $$$l, r \geq 0$$$