<?php $stdin = fopen('php://stdin','r'); $count = trim(fgets($stdin)); //var_dump($count);die(); for($i=1;$i<$count;$i++){ $input[] = trim(fgets($stdin)); } $inputBackup = $input; //var_dump($input); foreach($input as &$v){ list($add,$num[]) = explode('/',$v); $add = explode('...