| 16 | } |
| 17 | |
| 18 | int money(int a[],int n,int m,int sum) |
| 19 | { |
| 20 | if(sum==m) // that means gila and mila have same amount of money |
| 21 | return 1; |
| 22 | if(sum<m) |
| 23 | return 0; // because Mila won't share her money |
| 24 | int x; |
| 25 | x=sum-m; // the amount that to be distributed between mila and gila |
| 26 | if(x%2!=0) |
| 27 | return 0; // amount to be distributed can't be in fraction |
| 28 | x=x/2; |
| 29 | if(findsum(a,n,x)) |
| 30 | return 1; |
| 31 | return 0; |
| 32 | } |
| 33 | |
| 34 | int main() { |
| 35 | int t; // t for no of test cases |