← All problemsSign in

Gemstones

Dhruv loves rare gemstones. Dhruv wants 3 different gemstones with their rarity **a**,**b**,**c**. Such that **a**,**b**,**c** are in GP with common ratio **r** . - So, Dhruv decided to buy 3 gemstones from a shop. This shop has N different gemstones with their rarity defined. Find in how many ways Dhruv can choose these 3 gemstones A[ **i** ] , A[ **j** ], A[ **k** ] such that (**1** ≤ **i** < **

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start