<?php
// 1- receive the number of test cases (times the first 'for' loop reads Food in Kg)
fscanf(STDIN, "%d", $NumberOfTestCases);
// 2- the for below will loop X times (X = $NumberOfTestCases) and reads a different $FoodInKg value each time
for ($i=0;$i<$NumberOfTestCases;$i++) {
// 3- the fscanf below create variable $FoodInKg and atribute the input value to it
fscanf(STDIN, "%f", $FoodInKg);
// 4.0- the for below will simulate Blobs eating half of remaning food
// 4.1- $FoodInKg/2 until $FoodInKg <= 1kg
// 4.2- each time the loops happens, the amount of food will be updated
for($i2=0;$FoodInKg > 1;$i2++);
$FoodInKg /= 2;
}
// 5.0- when the loops above ends the updated days ($i2) will be shown
// 5.1- the first
echo "{$i2} dias\n";
?>
To embed this project on your website, copy the following code and paste it into your website's HTML: