1096A Find Divisible codeforces


  1. Problem link
  2. Solution O(1)
  3. #include<stdio.h>
  4. #include<iostream>
  5. using namespace std;
  6. int main()
  7. {
  8. long int l,r;
  9. int t;
  10. cin>>t;
  11.  
  12. long int x=l,y=r;
  13. while(t--)
  14. {
  15. scanf("%ld",&l);
  16. scanf("%ld",&r);
  17. y=r;
  18. int mod=(r%l);
  19. cout<<l<<" "<<r-mod<<endl;
  20.  
  21. mod=0;
  22.  
  23.  
  24. }
  25. return 0;}

Comments

Popular posts from this blog

Codeforce Problem 1703A. YES or YES?

1535A. Fair Playoff

Aptitude test assistant programmer 2018