|
||||||||||
IntervalTime Limit: 6000/3000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 169 Accepted Submission(s): 52 Problem Description Alice get M sequences ordered from 1 to M. Now she rearrange the M sequences and connect them from left to right to get a new sequence. And she wanna know the sum of great common divisores of all different interval of the result sequence. She define the sum as beautiful value but it's not the answer. We can easy know there are M! different rearrangements. She want to calculate the sum of beautiful value of all rearragements. It's too difficult. So help her please. Output the answer mod 1000000007. Input The input contains multiple test cases. For each test case, the first line contains one integer $M(1\leq M\leq 80000)$. Then followed M lines. Each line start with a integer $S(1\leq S\leq 80000)$, then followed S integers. The sum of S is not big than 80000. All integers are between 1 and 80000. Output For each test case, output the answer mod 1000000007. Sample Input
Sample Output
Author ZSTU Source | ||||||||||
|