fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define io std::ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  4. #define file(name) {freopen(name".INP","r",stdin);freopen(name".OUT","w",stdout);}
  5. int main (){
  6. io;file("SUM");
  7. int n;cin>>n;
  8. int x=n/7;
  9. int sum=((x*(x+1))/2)*7;
  10. cout<<sum;
  11. return 0;}
  12.  
  13.  
  14.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
Standard output is empty