#Lutece2495. An Easy Math Problem I
An Easy Math Problem I
Migrated from Lutece 2495 An Easy Math Problem I
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
给定 这个正整数,计算下式的值
表示 的小数部分。
Input
第一行有一个正整数 。
下面有 组测试用例,每个测试用例包含两个正整数 。
Output
对于每个测试用例,输出一个整数表示该式子的值。
如果答案可以表示成 的形式,请输出 的值,其中 表示 在模 意义下的乘法逆元。
Samples
1
1 3
499122177
Resources
2020 UESTC ICPC Training for Math and Geometry