Shivani Watches Squares Vs Cubes
CodeChefOpen on judge ↗
Shivani loves perfect squares and perfect cubes, Harshit still loves his 5T. She has 2 numbers m and n, she wants to find the smallest and strictly positive number A such that m*A is a perfect square and n*A is a perfect cube. Since the number A can be large, she asks you to find the total divisors of the number A. If such a number doesnt exist, print -1. Input First line of input contains a
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start