This is the problem of [cses coin piles](https://cses.fi/problemset/task/1754). 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.
↵
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.




