Advertisement
mhdew

DIU_TC_01 D

Aug 3rd, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. ///Template
  6. #define in1()   freopen("E:\\Random Programs\\template\\test_input.txt", "r", stdin)
  7. #define out1()  freopen("E:\\Random Programs\\template\\test_output.txt", "w", stdout)
  8. #define in2(f)  freopen("f", "r", stdin)
  9. #define out2(f) freopen("f", "w", stdout)
  10.  
  11. //Datatypes
  12. #define l       long
  13. #define ll      long long
  14. #define llu     unsigned long long
  15.  
  16. //loop
  17. #define f1(i,x,y)   for(int i=x;i<=y;i++)
  18.  
  19. //Constants
  20. #define MAX     10000007
  21. #define PI      acos(-1.0)
  22.  
  23. int main()
  24. {
  25. //  in1();
  26. //  out1();
  27.     double a, b;
  28.     cin>>a>>b;
  29.  
  30.     a=a+1e-15;
  31.     b=b+1e-15;
  32.  
  33.     ll x=a*1000000000;
  34.     ll y=b*1000000000;
  35.     ll rem=x%y;
  36.  
  37.     double d=rem/(1000000000*1.0);
  38.  
  39.     printf("%0.9lf\n", d);
  40.  
  41.     return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement