vicheslit pmt p com cred
= ( ms
+ 1 , last , total
) where last = p
* ( cred
* p
^ ms
+ ( p
^ ms
- 1 ) / ( p
- 1 ) * ( com
- pmt
) ) + com
shkolnik pmt ( bname, p, com, cred) = fmt $ vicheslit pmt p com cred where
"total paid: " ++ show total
]
main
= mapM_ ( putStrLn . shkolnik
5000 ) [ ( "homoCredit" , 1.04 , 500 , 39999 ) , ( "softBank" , 1.03 , 1000 , 39999 ) ,
( "strawberryBank" , 1.02 , 0 , 47776 ) ]
dmljaGVzbGl0IHBtdCBwIGNvbSBjcmVkID0gKG1zKzEsbGFzdCx0b3RhbCkgd2hlcmUKICAgIG1zID0gZmxvb3IgJCBsb2dCYXNlIHAgKChjb20tcG10KS8oKHAtMSkqY3JlZCtjb20tcG10KSkKICAgIGxhc3QgPSBwKihjcmVkKnBebXMgKyAocF5tcy0xKS8ocC0xKSooY29tLXBtdCkpK2NvbQogICAgdG90YWwgPSBsYXN0K3BtdCpmcm9tSW50ZWdyYWwgbXMKCnNoa29sbmlrIHBtdCAoYm5hbWUscCxjb20sY3JlZCkgPSBmbXQgJCB2aWNoZXNsaXQgcG10IHAgY29tIGNyZWQgd2hlcmUKICAgIGZtdCAobXMsbGFzdCx0b3RhbCkgPSB1bmxpbmVzIFtibmFtZSArKyAiOiIsCiAgICAJCQkJCQkJICAgc2hvdyBtcyArKyAiIG1vbnRocyIsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImxhc3QgcGF5bWVudDogIiArKyBzaG93IGxhc3QsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInRvdGFsIHBhaWQ6ICIgKysgc2hvdyB0b3RhbF0KICAgIAptYWluID0gbWFwTV8gKHB1dFN0ckxuIC4gc2hrb2xuaWsgNTAwMCkgWygiaG9tb0NyZWRpdCIsMS4wNCw1MDAsMzk5OTkpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgic29mdEJhbmsiLDEuMDMsMTAwMCwzOTk5OSksCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCJzdHJhd2JlcnJ5QmFuayIsMS4wMiwwLDQ3Nzc2KV0=