First of all you should not print input: and output: . Then transaction is accepted if the charges can also be subtracted , so you should compare x with k. here is your corrected code :
There shouldn’t be anything to be printed except the answers.Not even "input " or “output”.Also you should not use “\t” during taking input as it will only accept the input if there will be tab which is not here.So you should take the input without any tab