|
||||||||||
Fan LiTime Limit: 12000/6000 MS (Java/Others) Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 596 Accepted Submission(s): 152 Problem Description Fan Li (·¶ó») was an ancient Chinese advisor in the state of Yue in the Spring and Autumn period. He is a successful militarist and a successful business man. He is one of the main characters of a famous Chinese proverb ¡°ÎÔн³¢µ¨¡±. One day, when he was training the army, he came up with an idea, if he let all the soldiers stand in a line (every soldier has a fighting capacity), what is the maximum disjoint intervals he can choose so that the greatest common divisor of all the intervals are equal, and how many ways can he choose the maximum disjoint intervals satisfy the condition. The different ways may be very large, output the answer mod 998244353. Input There are multiple test cases. Each test cases begins with an integer n, then followed n positive integers. 1 <= n <= 100000 All the integers are less than 2333333. Output For each test case, output the number of maximum intervals and the ways of reach the maximum number. Sample Input
Sample Output
Author ZSTU Source | ||||||||||
|