#Lutece3248. 超能粒子炮·改
超能粒子炮·改
Migrated from Lutece 3248 超能粒子炮·改
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
曾经发明了脑洞治疗仪与超能粒子炮的发明家 SHTSC 又公开了他的新发明:超能粒子炮・改——一种可以发射威力更加强大的粒子流的神秘装置。
超能粒子炮・改相比超能粒子炮,在威力上有了本质的提升。它有两个参数 ,它会向每个编号为 到 (包含两端)的位置 发射威力为 的粒子流。
现在 SHTSC 给出了他的超能粒子炮・改的参数,让你求出其发射的粒子流的威力之和除以 所得的余数。
Input
第一行一个整数 表示数据组数。
之后 行,每行两个整数 ,含义如题面描述。
Output
行,每行一个整数,表示其粒子流的威力之和模 的值。
Samples
Constraints
1个数据点, ;
1个数据点, ;
1个数据点, ;
1个数据点, ;
1个数据点, .
Resources
2024 UESTC ICPC Training for Math