BONUS (ACMKANPB)

For this Problem It is mentioned in the problem statement that no one goes empty handed.
But for this test case

1
5 4 100
1 3 10
2 3 45
3 4 76
3 5 87

The best solution CodeChef: Practical coding for everyone gives the output
683
186 221 176 100 0

but according to me there should be no person going with 0 bonus. Our solution is CodeChef: Practical coding for everyone. Please check it!!!