Skip to content

Instantly share code, notes, and snippets.

@omarnazih
Created February 6, 2019 20:21
Show Gist options
  • Save omarnazih/5e81c47b8cd29813833d088cef353178 to your computer and use it in GitHub Desktop.
Save omarnazih/5e81c47b8cd29813833d088cef353178 to your computer and use it in GitHub Desktop.
codeforces-732A---Buy-a-Shovel.cpp
#include <iostream>
using namespace std;
int main()
{
int k,r;
int x = 0;
cin>> k >> r;
do{
if((x+r)%k == 0){
x+=r;
break;
}
x+=10;
}while(x % k != 0);
cout << x / k;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment