ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1493. One Step from Happiness

Can you give me solution?
Posted by bekmyrat 2 Nov 2012 13:38
Re: Can you give me solution?
Posted by Plamen_N 2 Nov 2012 21:06
Add '1' to the input number and see if it's lucky, i.e. if the sum of the first 3 digits is the same as the sum of the second 3 digits of the newly formed number.
Subtract '1' from the input number and check the same.
Output 'Yes' if the newly formed number satisfies the condition, and 'No' otherwise.