POPB - Editorial

PROBLEM LINK:

Practice

Contest

Author: Akshay Venkataramani

Tester: Timothy Jeyadoss

DIFFICULTY:

Easy

PREREQUISITES:

Simple Math

EXPLANATION:

Length wise, we could have produced a maximum of floor(N/K) squares and width wise, we could have produced a maximum of floor(M/K) squares. Multiply these two for the answer.

(N*M)/(K*K) might seem like a solution, but consider this : N=5,M=7,K=4. (7 * 5)/(4 * 4) is 2, but we can only produce one square from this rectangle(You can work it out by paper on why that’s the case!)

AUTHOR’S SOLUTION:

Author’s solution can be found here.