#K79052. Transaction Validation
Transaction Validation
Transaction Validation
You are given a list of transactions. Each transaction consists of three integers ( B ), ( A ), and ( C ). A transaction is considered valid if the account balance after deducting a specified amount ( A ) is at least ( C ), i.e., if ( B - A \geq C ). Otherwise, it is considered to be a case of insufficient funds.
Your task is to process multiple transactions and determine for each one whether it is a 'successful transaction' or if it has 'insufficient funds'.
inputFormat
The first line contains an integer ( T ) representing the number of transactions. Each of the next ( T ) lines contains three space-separated integers ( B ), ( A ), and ( C ), representing the initial balance, the deducted amount, and the minimum required remaining balance respectively.
outputFormat
For each transaction, print a line containing the string "successful transaction" if ( B - A \geq C ), or "insufficient funds" otherwise.## sample
2
1000 200 500
500 300 100
successful transaction
successful transaction
</p>