import Text.Printf
where f r@((a, b):r') = if b < 0 then (a + b, 0) : r' else f $ (a + mp, b * p + sp - mp) : r
main
= mapM_ (uncurry (printf
"Выплачено: %9.2f | Долг: %9.2f\n")) $ cPlan
40000 1.03 1000 5000
aW1wb3J0IFRleHQuUHJpbnRmCmNQbGFuIHQgcCBzcCBtcCA9IHJldmVyc2UgJCBmIFsoMCwgdCkgOjogKEZsb2F0LCBGbG9hdCldCiAgICB3aGVyZSBmIHJAKChhLCBiKTpyJykgPSBpZiBiIDwgMCB0aGVuIChhICsgYiwgMCkgOiByJyBlbHNlIGYgJCAoYSArIG1wLCBiICogcCArIHNwIC0gbXApIDogcgoKbWFpbiA9IG1hcE1fICh1bmN1cnJ5IChwcmludGYgItCS0YvQv9C70LDRh9C10L3QvjogJTkuMmYgfCDQlNC+0LvQszogJTkuMmZcbiIpKSAkIGNQbGFuIDQwMDAwIDEuMDMgMTAwMCA1MDAw