Tanabata Festival (hd1215) Why do you do this today t_t

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.