Floor And Ceil Division
Computer Mathematics
Hard
3 views
Problem Description
Given integers a and b>0, print floor(a/b) and ceil(a/b).
Input Format
Two integers a b.
Output Format
Two integers: floor ceil.
Official Solution
floor = Math.floor(a/b) for real division. For ceil: if a%b==0 then a/b else floor+1 when a>0, handle negatives carefully using integer rules.
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!