three men and three demons want to cross river.However,there's no bridge over the river and only a small boat is available.the boat can hold only two of them(one man and one demon,or two men.).whichever side of river,as long as there are more demons than men(for example,two demons one man,3 demons 2 men,3 demons 1 man),man would be eaten by demons.while the boat must be operated by someone(man or demon).question:how to make sure that they cross the river safely?
the process is as follow:
first,2 demons cross to the other side with the boat,and one of them row the boat back.so there's 1 demon left at the other side and 3 men 2 demons at this side.second ,2 demons cross the river,and one of them cross back.thus,there are 2 demons at the other side,and 3 men one demon this side.third,two men row over,and one man,one demon cross back from the other side.thus,1 man 1 demon at the other side,and 2 man 2 demons at this side.finally,2 men cross the river,and one demon cross back from the other side.so there are 3 men at the other side and 3 demons at this side.Then what is left is that 2 of the 3 demons cross the river and one of them come back to pick up the last one~