Hi,

I have written the following code in PHP for problem http://www.codechef.com/problems/A4/

```
while(FALSE !== ($t = fgets(STDIN))) {
$n = array();
$k = array();
for($i = 0; $i < $t; $i++) {
list($n[], $k[]) = explode(' ', fgets(STDIN));
}
for($i = 0; $i < $t; $i++) {
$pow_res = bcpow($n[$i], $n[$i]);
printf("%d %d\n", substr($pow_res, 0, intval($k[$i])), substr($pow_res, strlen($pow_res)-$k[$i]));
}
}
```

However I get time limit exceeded. Please help me to optimize it.