Algorithm title: Codeforces 236B

Source: Internet
Author: User
Tags time limit

Link:

Http://www.codeforces.com/problemset/problem/236/B

Topic:

B. Easy Number Challenge

Time limit per test

2 seconds

Memory limit per test

256 Megabytes

Input

Standard input

Output

Standard output

Let ' s denote D (n) as the number of divisors of a positive integer n. You are given three integers a, B and C. Your task is to calculate the following sum:

Find the sum modulo 1073741824 (230).

Input

The contains three space-separated integers a, B and C (1≤a,b,c≤100).

Output

Print a single integer-the required sum modulo 1073741824 (230).

Sample Test (s)

Input

2 2 2

Output

20

Input

5 6 7

Output

1520

Note

For the the example.

D (1 1 1) =d (1) = 1;
D (1 1 2) =d (2) = 2;
D (1 2 1) =d (2) = 2;
D (1 2 2) =d (4) = 3;
D (2 1 1) =d (2) = 2;
D (2 1 2) =d (4) = 3;
D (2 2 1) =d (4) = 3;
D (2 2 2) =d (8) =4.

So this is 1+2+2+3+2+3+3+4=20.

Analysis and Summary:

Bare factor number, data comparison water can be violent, but as long as give a 100 100 100, will be tle by others hack off.

For me this kind of maths weak force, when playing CF can only temporary Baidu a more efficient way ...

Condition: Given any one positive integer n

Requirements: Number of factors to be obtained

Firstly, the conclusion is given that for any integral type N, the decomposition decomposition gets n= p1^x1 * p2^x2* ... * PN^XN;

The number of factors M for n is m= (x1+1) * (x2+1) * ... * (xn+1);

Certification process:

Let's give you an example.

24 = 2^3 * 3^1;

The mass factors are as follows: 2 and 3 indices are 3 and 1.

Then for 2 there are 0 1 2 34 index options, for 3 0 of the index options

So that's 4 * 2 = 8 number of factors

If you still don't understand, then let's list it.

2 3

2^0*3^0=1 2^0*3^1=3

2^1*3^0=2 2^1*3^1=6

2^2*3^0=4 2^2*3^1=12

2^3*3^0=8 2^3*3^1=24

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.