fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. unsigned int a, m, n = 0;
  6. cin>>a>>m;
  7. while (m - 2 * a != 0){
  8. m -= a;
  9. a ++;
  10. n ++;
  11. }
  12. cout<<n + 1;
  13. return 0;
  14. }
Success #stdin #stdout 0s 15232KB
stdin
5 25
stdout
3