Sunday, April 26, 2020

1A. Theatre Square solution


  1. #include
    <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long double a, n, m, temp;
  8.  
  9. cout.precision(22);
  10. cin >> n >> m >>a;
  11. if(m < n)
  12. {
  13. temp = m;
  14. m = n;
  15. n = temp;
  16. }
  17.  
  18. if(a >= m)
  19. {
  20. cout << ceil(n/a) << endl;
  21. }
  22. else
  23. {
  24. cout << ceil(m/a)*ceil(n/a) << endl;
  25. }
  26. return 0;
  27. }

No comments:

Post a Comment

Aptitude test assistant programmer 2018

 #include <stdio.h> #include <stdlib.h> int main() { char str[100]; int i; int space=0;     printf("Enter a string\n")...