Hello there,
i tried to understand the problem of piggy bank (http://www.spoj.pl/problems/PIGBANK/) . But it seems like i am going in wrong direction. I need to find the min amount.
Sample input :
3
10 110
2
1 1
30 50
10 110
2
1 1
50 30
1 6
2
10 3
20 4
output is:
1. 60
2. 100
3. impossible
I am not able to figure out the solution here. any here will be userful
Thanks