logo AlgoBeat OnlineJudge
登录 注册

#217586. [ICPC 2019 Yinchuan R] Function!

内存限制:512 MiB 时间限制:1000 ms 标准输入输出
题目类型:VJudge(洛谷) 评测方式:VJudge
上传者: 匿名

题目描述

Define the function

for all .

You are asked to calculate the value of

where is the inverse function of , is the largest integer that is less than or equal to , and is the smallest integer that is greater than or equal to .

Since the value could be very large, please output the value modulo .

输入格式

An integer described above.

输出格式

An integer denotes the value you have calculated modulo .

样例

样例输入 1

2

样例输出 1

2

样例输入 2

10

样例输出 2

236