fork download
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4. int x,y,n;
  5. cin>>x>>y;
  6. n=x%y;
  7. if(n==0)
  8. {cout<<"-1"<<endl;}
  9. else
  10. {cout<<n<<endl;}
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 5292KB
stdin
Standard input is empty
stdout
3013