Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <algorithm>
- #include <iostream>
- #include <iterator>
- #include <numeric>
- #include <sstream>
- #include <fstream>
- #include <cassert>
- #include <climits>
- #include <cstdlib>
- #include <cstring>
- #include <string>
- #include <cstdio>
- #include <vector>
- #include <cmath>
- #include <queue>
- #include <deque>
- #include <stack>
- #include <list>
- #include <map>
- #include <set>
- using namespace std;
- int main()
- {
- int tc;
- cin>>tc;
- for(int i=1;i<=tc;i++){
- int n,k,x;
- cin>>n>>k>>x;
- int tw=n*(n+1)/2;
- int sn=k*(2*x+(k-1)*1)/2;
- printf("Case %d: %d\n",i,tw-sn);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement