Tanabata Festival Problem Description Tanabata day, matchmaker came to the digital kingdom, he posted a notice on the city gate, and the people of the Digital Kingdom said: "You want to know who your other half is?" then follow the signs on the way to find it!
People come to the notice before they want to know who is their other half. The notice is as follows:
The factor of the number n is all positive integers that are smaller than n and divisible by n, such as the factor of 12 having 1,2,3,4,6.
Do you want to know your other half?
The first line of input data is a number T (1<=t<=500000), which indicates the number of groups of test data. Then there is the T-group test data, each set of test data has only one number N (1<=n<=500000).
Output for each set of test data, export a number that represents the other half of the input data N.
Sample Input321020 Sample Output1822
1#include <stdio.h>2 intMain ()3 {4 intn,i,a,j,sum,c;5 while(SCANF ("%d", &n)! =EOF)6 {7 for(i=1; i<=n;i++)8 {9sum=0;Tenscanf"%d",&a); OneC=A; A for(j=2; j<c;j++) - if(a%j==0) - { thesum+=J; - if(j!=a/j) - { -sum+=a/J; +c=a/J; - } + } Asum++; atprintf"%d\n", sum); - } - } -}
Tanabata Festival (hd1215) Why do you do this today t_t