Ciel and A-B ProblemProblem code: CIELAB |
All submissions for this problem are available.
In Ciel's restaurant, a waiter is training. Since the waiter isn't good at arithmetic, sometimes he gives guests wrong change. Ciel gives him a simple problem. What is A-B (A minus B) ?
Surprisingly, his answer is wrong. To be more precise, his answer has exactly one wrong digit. Can you imagine this? Can you make the same mistake in this problem?
Input
An input contains 2 integers A and B.
Output
Print a wrong answer of A-B. Your answer must be a positive integer containing the same number of digits as the correct answer, and exactly one digit must differ from the correct answer. Leading zeros are not allowed. If there are multiple answers satisfying the above conditions, anyone will do.
Constraints
1 ? B < A ? 10000
Sample Input
5858 1234
Sample Output
1624
Output details
The correct answer of 5858-1234 is 4624. So, for instance, 2624, 4324, 4623, 4604 and 4629 will be accepted, but 0624, 624, 5858, 4624 and 04624 will be rejected.
Notes
The problem setter is also not good at arithmetic.
| Author: | laycurse |
| Date Added: | 22-11-2011 |
| Time Limit: | 1 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TCL, TEXT, WSPC |
Comments

Fetching successful submissions

I am new to codechef when to
@ujjwal_invent all test cases
@ujjwal_invent: Please check
@ujjwal_invent: Please check the FAQ link http://www.codechef.com/wiki/faq#If_a_number_of_test_cases_isn-t_provide...
what if the right answer
@niting112 read the output
4620 can be the answer?
do we need to check contraint
I am getting correct output
@ab1234 Yes
@sharmasahil as you wish if
@sharmasahil there are many
if input will be 12 10 then
Does this problem have only
@aarvay only one in each
@tarun29061990 any one from 1
can 4625 be an answer for
In the input file, first
@bilalgce Yes
@niting112 Yes
yes !! finally got my first
Can B be greater than A ??
@casy No. please read the
@admin; thankyou so much. got
What should be the answer for
@casy read the input
@casy read constraint