1) { $doubleCount = $value -1; $ans += ($doubleCount * ($yukiHotel + $insteadHotel)); } } echo $ans;