Guest User

Untitled

a guest
Nov 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. inputs(Name,n,k):
  2. [('a',30,40),('b',40,50),('c',30,15)]
  3. [('a',30,30),('b',20,20)]
  4. [('a',30,100),('b',30,2),('c',40,0)]
  5. [('a',344,333),('b',344,200),('c',2,2)]
  6. [('a',450,400),('b',300,300),('c',35,55)]
  7.  
  8. outputs(P1,P2,Amount)-P1 owes Amount to P2:
  9. [('c','a',10),('c','b',5),('owner','b',5)] or [('c','b',10),('c','a',5),('owner','a',5)]
  10. []
  11. [('owner','a',2),('b','a',28),('c','a',40)] PS: [('owner','a',2),('b','a',68),('c','b',40)] is not a valid answer even though number of transactions is same as it is not the most simplified version.
  12. [('a','owner',11),('b','owner',144)]
  13. [('a','owner',30),('a','c',20)]
Add Comment
Please, Sign In to add comment