10209. Play with digits

I'm a slow walker, but I never walk backwards.

Task Description

We have a huge decimal number. Write a program to compute the following answers:

  • The number of digits.
  • 1 if it is even; 0 otherwise.
  • The number of zeros in digits.
  • 1 if it is divided by 11; 0 otherwise.

We will give you the number digit by digit in lines. If you get digits ‘1’, ‘2’, ‘3’, ’4’, ‘0’ in order, then the decimal number is 12340.

Input Format

The input has several lines. Each line has a digit. EOF indicates the end of input.

Output Format

Output the answer above line by line.

Subtask

  • 10 points: you can store the decimal number in an integer without overflow
  • 10 points: the number of digits is no more than 32768, so you can store digits in an array
  • 80 points: you will get MLE if you use array

Sample Input 1

1
2
3
4
0

Sample Output 1

5
1
1
0

Discussion