do not show borders...
[git/dscho.git] / sovrce-1232992321.txt
blobeb0fa04937f3d34e278a46b097984aa563c29f71
1 #!/usr/bin/perl
3 @A = (0, 6);
4 @B = (0, 1);
5 @C = ("", "(0,1)");
7 $N = 100000;
8 for ($i = 2; $i < $N; $i++) {
9 $A[$i] = 5 + $i;
10 $B[$i] = 1;
11 $C[$i] = "(0,$i)";
12 for ($j = 3; $j <= $i / 2; $j++) {
13 $k = int($i / $j);
14 $l = $i - $j * $k;
15 $tmp = $A[$j] + 5 + 2 * $k + $l;
16 if ($A[$i] > $tmp) {
17 $A[$i] = $tmp;
18 $B[$i] = $B[$j] + 1;
19 $C[$i] = $C[$j] . " ($k,$l)";
24 for ($n = 1; $n < $N; $n++) {
25 printf("% 5d: % 5d %d %s\n", $n, $A[$n], $B[$n], $C[$n]);