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

Function

Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 1431    Accepted Submission(s): 373


Problem Description
Jerry is fond of functions. He thinks the mystery of the universe is hidden behind the notations, variables and numbers.
Of all functions, he thinks $\gcd$ and $\lfloor x\rfloor$ are the most fascinating, and that something combines gcd with truncation should be even more marvelous.
Therefore, he comes up with a problem: calculate
$\sum_{i=1}^n\gcd(\lfloor{\sqrt[3]{i}}\rfloor,i)\mod 998244353$
 

Input
The input contains several test cases.
The first line contains an integer $T(1\le T\le 11)$, the number of test cases.
Each of the next $T$ lines contains a integer $n(1\le n\le 10^{21})$, indicating a query.
 

Output
For each test case, output one line containing an integer indicating the corresponding answer.
 

Sample Input
10 64 180 526 267 775 649 749 908 300 255
 

Sample Output
103 327 1069 522 1693 1379 1631 1998 606 492
 

Hint
g++ compiler on HDOJ supports __int128. And you may need the following function:

template <class T>
void read(T &x) {
  static char ch;static bool neg;
  for(ch=neg=0;ch<'0' || '9'<ch;neg|=ch=='-',ch=getchar());
  for(x=0;'0'<=ch && ch<='9';(x*=10)+=ch-'0',ch=getchar());
  x=neg?-x:x;
}

 

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-04-25 15:49:57, Gzip enabled