编程介的小学生 2019-08-26 19:41 采纳率: 20.5%
浏览 79

Sum the K-th's 的问题

Problem Description
N integers are arranged on a circle clockwise. Given two integers M & K. For each position, you should take M continuous integers on the left and M continuous integers on the right. Take out the K-th number of the 2M integers. Then you will get N integers. Add all the integers up and tell me the sum. If the answer is not smaller than 1,000,000,007, divide it by 1,000,000,007 and tell me the remainder.

Input
There is an Integer T in the first line. Which means the number of test cases in the input file. Then followed by T test cases.
For each test case, in the first line there are 3 Integers N(5<=N<=100,000),M(0<M*2<N),K(0<K<=2*M). Then there are N Integers, all the integers are non-negative Integers and smaller than 1,000,000,000.

Output
For each test case, output the answer for a line.

Sample Input
2
5 2 2
1 2 3 4 5
5 1 2
1 2 3 4 5

Sample Output
12
21

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 matlab求解平差
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料
    • ¥15 使用R语言marginaleffects包进行边际效应图绘制
    • ¥20 usb设备兼容性问题
    • ¥15 错误(10048): “调用exui内部功能”库命令的参数“参数4”不能接受空数据。怎么解决啊
    • ¥15 安装svn网络有问题怎么办
    • ¥15 vue2登录调用后端接口如何实现