zax2002

calc

Oct 18th, 2017
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.39 KB | None | 0 0
  1. program calc;
  2. var
  3.     N:integer;
  4.     M:integer;
  5.     X:integer;
  6.     Y:integer;
  7.     result_a:real;
  8.     result_b:real;
  9. begin
  10.     readln(N);
  11.     readln(M);
  12.     readln(X);
  13.     readln(Y);
  14.    
  15.     if N/X > int(N/X) then result_a := int(N/X) + 1 else result_a := int(N/X);
  16.     if M/Y > int(M/Y) then result_b := int(M/Y) + 1 else result_b := int(M/Y);
  17.  
  18.     writeln(result_a + result_b:0:0);
  19. end.
Advertisement
Add Comment
Please, Sign In to add comment