What is error in the code?
hello @kailash_01
your logic is correct, u have done mistake in taking input

change r with c and c with r. in above highlighted part it will work;
hello @kailash_01
your logic is correct, u have done mistake in taking input

change r with c and c with r. in above highlighted part it will work;