A HOTEL with 1000 rooms has 1000 waiters. Each waiter and room is given a number from 1-1000.

Initially, waiter with number 1 goes and closes doors of all rooms.

After that waiter with number 2 goes and changes the state of doors corresponding to multiples of that 2.

After that waiter number 3 goes and changes the state of doors corresponding to multiples of 3.

So on and so forth

Find the number of doors that are open after the 1000th waiter has returned .

NOTE: Changes the state of door means that opened doors are closed and closed doors are opened.

×

Problem Loading...

Note Loading...

Set Loading...