935 A. Fafa and his Company solution


  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;cin>>n;
  6. int ans =0,em=0,lr=0,i;
  7. for(i=1;i<n;i++)
  8. {lr=i;
  9. em= n-i;
  10. if(lr+em==n and em%lr==0) ans++;
  11. }
  12.  
  13. cout<<ans;
  14. return 0; }

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

Aptitude test assistant programmer 2018

1041A. Heist solution