Skip to content
We areTOP 1%

Theatre Square

EasyRating 1000CodeforcesMath & Implementation
Solve on Codeforces(opens in a new tab)
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews
Approach hintTry it first, then reveal

Each side needs a ceiling division of its length by the flagstone size; multiply the two counts. The product can exceed 32 bits, so use long long.

More in Math & Implementation

Math & Implementation questions
#ProblemPlatformDifficultyOpen1st1st Visit2nd2nd VisitRevRevise
1WatermelonCodeforcesEasy 800Solve Watermelon on Codeforces (opens in a new tab)
2Fizz BuzzLeetCodeEasy Solve Fizz Buzz on LeetCode (opens in a new tab)
3ElephantCodeforcesEasy 800Solve Elephant on Codeforces (opens in a new tab)
4Soldier and BananasCodeforcesEasy 800Solve Soldier and Bananas on Codeforces (opens in a new tab)
5Divisibility ProblemCodeforcesEasy 800Solve Divisibility Problem on Codeforces (opens in a new tab)
6Palindrome NumberLeetCodeEasy Solve Palindrome Number on LeetCode (opens in a new tab)
7Plus OneLeetCodeEasy Solve Plus One on LeetCode (opens in a new tab)
8Happy NumberLeetCodeEasy Solve Happy Number on LeetCode (opens in a new tab)
9Multiply by 2, divide by 6CodeforcesEasy 900Solve Multiply by 2, divide by 6 on Codeforces (opens in a new tab)
10Even OddsCodeforcesEasy 900Solve Even Odds on Codeforces (opens in a new tab)
11Odd DivisorCodeforcesEasy 900Solve Odd Divisor on Codeforces (opens in a new tab)
12Almost PrimeCodeforcesEasy 900Solve Almost Prime on Codeforces (opens in a new tab)
13Theatre SquareCodeforcesEasy 1000Solve Theatre Square on Codeforces (opens in a new tab)
14K-th Not Divisible by nCodeforcesEasy 1200Solve K-th Not Divisible by n on Codeforces (opens in a new tab)
15Count PrimesLeetCodeMedium Solve Count Primes on LeetCode (opens in a new tab)
16Next PermutationLeetCodeMedium Solve Next Permutation on LeetCode (opens in a new tab)

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account