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