TABLE - Crash´s number table
In today's math lesson, Little Crash has just learnt Least Common Multiple (LCM). For two positive integers a and b, LCM(a, b) means the minimum positive integer which can be divisible by a and b.
After coming home, Crash is still thinking about what he learnt in the math lesson. Then he draw a table filled numbers in order to research LCM. The table has N rows and M columns. The number in the ith row and jth column is LCM(i, j).
A table of 4*5 is just like this:
1 | 2 | 3 | 4 | 5 |
2 | 2 | 6 | 4 | 10 |
3 | 6 | 3 | 12 | 15 |
4 | 4 | 12 | 4 | 20 |
Now Little Crash wants to know the sum of all the numbers in the table. You just need to output the sum modulo 20101009.
Input
Only two positive integers stand for N and M. (N, M <= 107)
Output
A positive integer which means the sum modulo 20101009.
Example
Input:
4 5
Output:
122
hide comments
pyy_official1:
2024-03-15 01:41:45
My solution runs about 0.2 second on my PC.But it gets TLE! Last edit: 2024-03-15 01:42:11 |
|
Rohmad Raharjo:
2011-09-09 06:52:19
Would you like give me another test cases? |
|
Nikmal Mursyidah:
2011-01-18 02:40:18
how to make a program runs faster?
|
|
mike_nzk:
2010-12-25 06:14:36
My program runs about 1.4 seconds on my PC but gets TLE in SPOJ. It's so strange!
|
|
jiazhipeng:
2010-12-22 14:07:44
to xilinx
|
|
[Rampage] Blue.Mary:
2010-12-22 13:55:06
There's no need to set time limit 0.1 second for some test cases. I think a better way is to merge all test cases in 1 file and give out the total time limit. See problems added by me. Last edit: 2010-12-22 13:56:09 |
|
jiazhipeng:
2010-12-22 02:47:08
to pratik:
|
|
.:: Pratik ::.:
2010-12-21 21:00:52
Is time limit strict the code in C++ runs on my machine in 5 seconds for worst case. |
Added by: | jiazhipeng |
Date: | 2010-12-20 |
Time limit: | 0.100s-1.274s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | C C++ 4.3.2 CPP C99 JAVA PAS-GPC PAS-FPC |
Resource: | Modified from task energy of NOI 2010 |