total + 1 or total + 2 identical tiles, and it should be as close to a square as possible.
Find two positive integers whose product is total + 1 or total + 2 and whose difference is as small as possible. Return the two numbers in any order.total=13 → [3, 5]
14 = 2 × 7 (difference 5), 15 = 3 × 5 (difference 2). The tighter pair is 3 and 5.
total=24 → [5, 5]
25 = 5 × 5, a difference of 0, which cannot be beaten.
total=5 → [2, 3]
6 = 2 × 3 (difference 1), while 7 is prime and only splits as 1 × 7. The answer is 2 and 3.
total ≤ 10⁹total=13
[3, 5]
Run checks the first 3 tests in your browser. Submit checks all 52 tests on the server, hidden ones included.