<?php
function totalPay($monthPay, $tax, $creditSum, $bankPercent) {
for($i = 0; $i <= 20; $i++){
$totalCredit = $creditSum * $bankPercent + $tax - $monthPay;
$total = 0;
$total = $total + $monthPay;
if($totalCredit < $monthPay){
brea
}
}
return $totalCredit;
}
$homoCredit = totalPay(5000, 500, 39999, 1.04);
$softBank = totalPay(5000, 1000, 39999, 1.03);
$strawberryBank = totalPay(5000, 0, 39999, 1.02);
$strawberryBankTax = $strawberryBank + 7777;
echo "{$homoCredit}\n";
echo "{$softBank}\n";
echo "{$strawberryBank}\n";
PD9waHAKZXJyb3JfcmVwb3J0aW5nKC0xKTsKCmZ1bmN0aW9uIHRvdGFsUGF5KCRtb250aFBheSwgJHRheCwgJGNyZWRpdFN1bSwgJGJhbmtQZXJjZW50KSB7Cglmb3IoJGkgPSAwOyAkaSA8PSAyMDsgJGkrKyl7CgkJJHRvdGFsQ3JlZGl0ID0gJGNyZWRpdFN1bSAqICRiYW5rUGVyY2VudCArICR0YXggLSAkbW9udGhQYXk7CgkJJHRvdGFsID0gMDsKCQkkdG90YWwgPSAkdG90YWwgKyAkbW9udGhQYXk7CgkJaWYoJHRvdGFsQ3JlZGl0IDwgJG1vbnRoUGF5KXsKCQkJYnJlYQoJCX0KCX0KCXJldHVybiAkdG90YWxDcmVkaXQ7Cn0KCiRob21vQ3JlZGl0ID0gdG90YWxQYXkoNTAwMCwgNTAwLCAzOTk5OSwgMS4wNCk7CiRzb2Z0QmFuayA9IHRvdGFsUGF5KDUwMDAsIDEwMDAsIDM5OTk5LCAxLjAzKTsKJHN0cmF3YmVycnlCYW5rID0gdG90YWxQYXkoNTAwMCwgMCwgMzk5OTksIDEuMDIpOwokc3RyYXdiZXJyeUJhbmtUYXggPSAkc3RyYXdiZXJyeUJhbmsgKyA3Nzc3OwoKZWNobyAieyRob21vQ3JlZGl0fVxuIjsKZWNobyAieyRzb2Z0QmFua31cbiI7CmVjaG8gInskc3RyYXdiZXJyeUJhbmt9XG4iOw==