fork download
  1. #include<bits/stdc++.h>
  2. #define int long long
  3. using namespace std;
  4. int32_t main()
  5. {
  6. int t=1;
  7. // cin>>t;
  8. while(t--)
  9. {
  10. int x,y;
  11. cin>>x>>y;
  12. for(int i=1; i<=1000; i++)
  13. {
  14. if((i*x)%10==0)
  15. {
  16. cout<<i;
  17. break;
  18. }
  19. if((i*x)%10==y)
  20. {
  21. cout<<i;
  22. break;
  23. }
  24. }
  25. return 0;
  26. }
  27. }
Success #stdin #stdout 0s 5312KB
stdin
Standard input is empty
stdout
1