Company: Rubrik_30oct
Difficulty: medium
Morty's Galactic Adventure Problem Description You are Morty and you have stumbled onto yet another one of Rick's crazy inventions. Rick has built a unique ship called the Interplanetary Traversal Vehicle that allows you to travel between planets scattered across the galaxy. Each planet is marked by a special unique number known as its planetary code. However, Rick's invention has a strange limitation: the traversal vehicle can only jump directly between planets if their planetary codes share some common factor greater than 1 (which means their planetary codes are "not coprime"). For example, the vehicle can move directly from planet code 10 (factors 2, 5) to planet code 15 (factors 3, 5) since they share the factor 5. But it cannot jump directly from planet 7 to planet 9, as they have no common factors greater than 1. Fortunately, Rick has equipped the ship with an additional special power: It can create artificial orbital clouds (fake planets) around existing planets. Each newly crea