P13688 [CodeChef] aran03
NOI
题目描述

We are very near to our goal now. The enemy is being weakened continuously. But alas, sensing his fall, the hacker has spread a worm into our network. It is consuming all our files at a tremendous rate and must be stopped at all costs. The only way to stop it is to enter a specific code number in to the worm. It is up to you to find an algorithm for the worm's stop code...Time is of the essence, my friend...

Input:

The first line will consist of the total number of test cases T.
The next T lines will consist of number N on each line.

Output:

For each test case, output is a number.

Example:
Input:

3
34
156
893

Output:

6
0
13

输入格式

见题面

输出格式

见题面

样例输入
3 34 156 893
样例输出
6 0 13