#include<bits/stdc++.h> using namespace std; int i,sum,j=1; int h(int i,int j){ i+=j; j++; return i; } int main(){ while(sum<5000){ sum+=h(i,j) } }