<?php
error_reporting(-1);

/* требуемая сумма */
$amount = 54500;


echo "Сумма: $amount";
if (($amount > 100)&(($amount % 100) == 0)){
	echo "\nВыдача возможна, число купюр: ";
$output5000 = floor($amount / 5000);
$amountLeft = $amount % 5000;
$output1000 = floor($amountLeft / 1000);
$amountLeft = $amountLeft % 1000;
$output500 = floor($amountLeft / 500);
$amountLeft = $amountLeft % 500;
$output100 = floor($amountLeft / 100);
$amountLeft = $amountLeft % 100;
echo "\n$output5000 х 5000, ";
echo "$output1000 х 1000, ";
echo "$output500 х 500, ";
echo "$output100 x 100";
}
elseif ($amount < 100){
echo "\nВыдача невозможна. Причина: сумма меньше 100 рублей.";
}
elseif (($amount % 100) != 0){
echo "\nВыдача невозможна. Причина: сумма не кратна 100 рублям.";
}


?>