Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Codeforces 732A
- #include <iostream>
- using namespace std;
- int main()
- {
- int k, r, ans = 0;
- cin >> k >> r;
- // k - 117, r - 3
- while(true)
- {
- ans++;
- if( ( ( k * ans ) - r ) % 10 == 0 )
- {
- break;
- }
- else if( (k * ans) % 10 == 0 )
- {
- break;
- }
- }
- cout << ans;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement