<?php

/**
 * Culture
 * Problem 1, AIC 2003
 * PHP Sample Solution
 */

// Open the input files.
$input_file fopen("cultin.txt""r");
$output_file fopen("cultout.txt""w");

// Read in the total number of bacteria.
$total fgets($input_file);

// Assume the experiment has been running for 0 days.
$start $total;
$days 0;

// While the initial number of bacteria is still even, halve this
// initial number and add one day to the experiment.
while ($start == 0) {
    
$start $start 2;
    
$days++;
}

// Now the initial number of bacteria is odd, so we must have our
// solution.
fprintf($output_file"%d %d\n"$start$days);

// Tidy up.
fclose($input_file);
fclose($output_file);