Advertisement
a53

ksir1

a53
Feb 9th, 2020
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. ///Emanuela Cerchez 100
  2. #include <fstream>
  3.  
  4. using namespace std;
  5. ifstream fin("ksir.in");
  6. ofstream fout("ksir.out");
  7. long long int k, total, grupa;
  8. int main()
  9. {fin>>k;
  10. grupa=1; total=0;
  11. while (total+2*grupa-1<k) {total+=2*grupa-1; grupa++;}
  12. if (k-total<=grupa) fout<<k-total<<'\n';
  13. else fout<<grupa<<'\n';
  14. fout.close();
  15. return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement