prob_32 flowkater solve by using Ruby