Strange Function

medium
https://codeforces.com/problemset/problem/1542/C

Input Format

Check link

Output Format

Check link

Constraints

Check link

Example

Input
6
1
2
3
4
10
10000000000000000
Output
2
5
7
10
26
366580019
Previous
About Bacteria
Next
Obtain A Permutation

Related Questions