题目描述 输入 输出 样例输入 2 3 2 63152 373 样例输出 2 11731552 #include<bits/stdc++.h> using namespace std; int main(){ int t,m; long long n; cin>>t; //若循环外定义是s,输出为多组数据结果的和 while(t--){ long long s=0; //循环内定义s cin>>n>>m; for(int i=1;i<=n;i++){ s+=i%m; }cout<<s<<endl; //循环内输出s } return 0; }