Company: Flipkart_12july
Difficulty: medium
Julie's City Tour Problem Description Julie is new to city D. She is curious to know about the city and plans to visit the city's landmarks. The landmarks of the city (numbered 1 to N) are well connected through the bus network. Julie plans to start from landmark #1 which is near her home (she can walk this distance) and wishes to visit as many landmarks as possible using the buses. However she has limited money to spend on bus tickets and to avoid getting lost in the new city, she decides to come back the same way she went out, retracing her steps. Write a program to help her to find out which are the landmarks she can visit and come back home before she runs out of money. Read the input from STDIN and print the output to STDOUT. Do not write arbitrary strings while reading the input or while printing, as these contribute to the standard output. Input Format The first line of input contains two integers (N and M) separated by a single white space, where N specifying the number of land