Help me in solving ICL1905 problem

My issue

Is it like we have to move continuosly from planet 1 to planet n , or we can leave some planets in between ?

My code

#include <iostream>
using namespace std;

int main() {
	// your code goes here
	return 0;
}

Problem Link: ICL1905 Problem - CodeChef

@lakshya1000
Its has to be continuous , but u can begin from any planet initially.