F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Least common multiple

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 1273    Accepted Submission(s): 434


Problem Description
bobo has an integer set S={x1,x2,¡­,xn}, where xi=2ai * 3bi.

For each non-empty subsets of S, bobo added the LCM (least common multiple) of the subset up. Find the sum of LCM modulo (109+7).
 

Input
The input consists of several tests. For each tests:

The first line contains n (1¡Ün¡Ü105). Each of the following n lines contain 2 integers ai,bi (0¡Üai,bi¡Ü109).
 

Output
For each tests:

A single integer, the value of the sum.
 

Sample Input
2 0 1 1 0 3 1 2 2 1 1 2
 

Sample Output
11 174
 

Author
Xiaoxu Guo (ftiasch)
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-10-31 09:11:34, Gzip enabled