Initial revision

master
penguinc 2004-11-02 07:15:54 +00:00
commit f8af7abd0d
21 changed files with 2159 additions and 0 deletions

54
a/clay.cpp Executable file
View File

@ -0,0 +1,54 @@
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(int argc, char **argv)
{
int class_size = 0;
int i = 0, j = 0;
int height = 0, width = 0, depth = 0;
int min = 0, max = 0;
string *students;
int *clay;
ifstream clay_in;
ofstream clay_out;
clay_in.open("clay.in");
clay_out.open("clay.out");
clay_in >> class_size;
while (class_size != -1) {
students = new string[class_size];
clay = new int[class_size];
min = 0;
max = 0;
for(i = 0; i < class_size; i++) {
clay_in >> height;
clay_in >> width;
clay_in >> depth;
clay_in >> students[i];
clay[i] = height * width * depth;
}
for(i = 0; i < class_size; i++) {
if (clay[i] < clay[min]) {
min = i;
}
if (clay[i] > clay[max]) {
max = i;
}
}
clay_out << students[max] << " took clay from " << students[min] << ".\n";
clay_in >> class_size;
}
clay_in.close();
clay_out.close();
return 0;
}

10
a/clay.in Executable file
View File

@ -0,0 +1,10 @@
3
10 10 2 Jill
5 3 10 Will
5 5 10 Bill
4
2 4 10 Cam
4 3 7 Sam
8 11 1 Graham
6 2 7 Pam
-1

2
a/clay.out Executable file
View File

@ -0,0 +1,2 @@
Bill took clay from Will.
Graham took clay from Cam.

68
d/tread.acm Executable file
View File

@ -0,0 +1,68 @@
Program 1
00:03 Speed 3 Inclination 6
00:10 Speed 4 Inclination 0
Program 2
00:02 Speed 2 Inclination 1
00:15 Speed 2 Inclination 2
00:33 Speed 3 Inclination 1
Program 3
00:00 Speed 3 Inclination 6
Program 4
00:00 Speed 3 Inclination 6
Program 5
00:01 Speed 3 Inclination 6
00:06 Speed 3 Inclination 6
Program 6
00:01 Speed 3 Inclination 6
00:07 Speed 3 Inclination 6
Program 7
00:02 Speed 2 Inclination 1
00:15 Speed 2 Inclination 2
00:33 Speed 3 Inclination 1
01:02 Speed 0 Inclination 3
02:30 Speed 3 Inclination 3
04:30 Speed 3 Inclination 6
05:00 Speed 4 Inclination 2
06:15 Speed 5 Inclination 2
08:00 Speed 6 Inclination 2
08:45 Speed 7 Inclination 2
09:30 Speed 7 Inclination 3
10:10 Speed 3 Inclination 5
10:40 Speed 3 Inclination 7
11:02 Speed 2 Inclination 3
11:41 Speed 1 Inclination 3
12:15 Speed 0 Inclination 0
Program 8
00:01 Speed 2 Inclination 1
00:14 Speed 2 Inclination 2
00:32 Speed 3 Inclination 1
01:01 Speed 0 Inclination 3
02:29 Speed 3 Inclination 3
04:29 Speed 3 Inclination 6
04:59 Speed 4 Inclination 2
06:14 Speed 5 Inclination 2
07:59 Speed 6 Inclination 2
08:44 Speed 7 Inclination 2
09:29 Speed 7 Inclination 3
10:09 Speed 3 Inclination 5
10:39 Speed 3 Inclination 7
11:01 Speed 2 Inclination 3
11:40 Speed 1 Inclination 3
12:14 Speed 0 Inclination 0
Program 9
00:02 Speed 2 Inclination 1
00:14 Speed 2 Inclination 2
00:33 Speed 3 Inclination 1
01:02 Speed 0 Inclination 3
02:30 Speed 3 Inclination 3
04:29 Speed 3 Inclination 6
05:00 Speed 4 Inclination 2
06:15 Speed 5 Inclination 2
08:00 Speed 6 Inclination 2
08:45 Speed 7 Inclination 2
09:29 Speed 7 Inclination 3
10:10 Speed 3 Inclination 5
10:40 Speed 3 Inclination 7
11:02 Speed 2 Inclination 3
11:41 Speed 1 Inclination 3
12:15 Speed 0 Inclination 0

242
d/tread.in Executable file
View File

@ -0,0 +1,242 @@
9
7 1 2 3 3 6 9 1 1 5 5 1 9 1 9 1 9 4 5 5 4 0 9 1 8 0 1 0 1 3
3 5 4 0 9 4 5 4 4 1 9 5 4 4 4 5 5 5 3 2 7 8 10
5 2 6 5 5 3 4 4 5 1 9 5 4 0 9 5 4 1 8 5 5 4 4 3 5 4 6 4 7 6
4 4 6 4 4 4 5 5 4 4 5 6 4 6 4 4 4 1 8 5 5 0 8 4 5 5 5 1 8 4
4 4 4 6 4 5 4 4 6 4 6 2 4 5 6 4 6 5 4 5 4 5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 3
2 1 5 1 5 6 5 4 5 0 8 5 5 0 8 5 4 0 8 1 9 5 4 3 4 5 5 6 7 5
4 5 2 7 5 5 4 4 4 5 3 5 3 5 5 4 4 6 4 3 6 5 3 5 5 4 4 3 5 6
3 4 4 5 4 2 7 3 6 5 4 6 5 4 6 5 2 4 7 5 4 5 3 5 4 3 3 5 4 7
4 6 5 3 3 3 4 5 6 5 7 4 4 8 8 2 3 0 5 3 3 5 4 1 1 2 5 3 1 7
3 6 4 4 5 4 0 9 1 8 4 4 4 5 0 9 1 9 4 4 8 2 4 3 3 4 4 2 5 2
0 5 5 4 3 6 7 4 6 5 5 3 4 4 4 6 4 4 7 3 3 7 3 4 5 3 3 7 1 4
4 6 3 5 4 4 6 7 3 5 5 2 5 4 3 3 2 4 4 0 6 6 3 7 5 3 5 6 6 3
8 5 4 5 3 4 3 8 5 3 4 6 5 4 5 4 4 4 0 8 4 5 4 4 4 4 4 5 4 4
4 4 2 4 5 4 3 5 2 3 4 7 2 4 6 5 5 6 1 4 8 3 2 6 6 4 7 3 3 3
5 5 10

67
d/tread.java Executable file
View File

@ -0,0 +1,67 @@
import java.io.*;
import java.util.regex.*;
import java.util.StringTokenizer;
import java.lang.Math;
import java.text.NumberFormat;
public class tread {
public static void main ( String[] args ) {
final String end = "10";
final Pattern chirp = Pattern.compile ( "[45] [45] [01] [89]" );
BufferedReader input;
PrintWriter output;
int programs = 0;
try {
input = new BufferedReader ( new FileReader ( "tread.in" ) );
output = new PrintWriter ( new FileOutputStream ( "tread.out" ) );
programs = Integer.parseInt ( input.readLine() );
for ( int count = 1; count <= programs; count++ ) {
output.println ( "Program " + count );
String line = input.readLine();
while ( !line.endsWith ( end ) ) {line += " " + input.readLine();}
int stringpos = 0;
Matcher m = chirp.matcher ( line );
while ( m.find ( stringpos ) ) {
stringpos = m.start();
int time = 0, incline = 0;
String tmp = line.substring ( m.end() );
if ( tmp.length() < 12 )
break;
StringTokenizer token = new StringTokenizer ( tmp );
for ( int c = 0; c < 3; c++ ) {
String t = token.nextToken();
String u = token.nextToken();
if ( (t.equals ( "0" ) || t.equals ( "1" )) && (u.equals ( "8" ) || u.equals ( "9" )) ) {
time += Math.pow ( 2, c );
}
}
for ( int c = 0; c < 3; c++ ) {
String t = token.nextToken();
String u = token.nextToken();
if ( (t.equals ( "0" ) || t.equals ( "1" )) && (u.equals ( "8" ) || u.equals ( "9" )) ) {
incline += Math.pow ( 2, c );
}
}
NumberFormat f = NumberFormat.getIntegerInstance();
f.setMinimumIntegerDigits ( 2 );
int minutes = (int)Math.floor ( stringpos / 360 );
int seconds = (int)Math.floor ( stringpos % 360 / 6 );
output.println ( f.format ( minutes ) + ":" + f.format ( seconds ) + " Speed " + time + " Inclination " + incline );
stringpos += 32;
}
}
input.close(); output.flush(); output.close();
}
catch ( Exception e ) {e.printStackTrace();}
}
}

68
d/tread.out Executable file
View File

@ -0,0 +1,68 @@
Program 1
00:03 Speed 3 Inclination 6
00:10 Speed 4 Inclination 0
Program 2
00:02 Speed 2 Inclination 1
00:15 Speed 2 Inclination 2
00:33 Speed 3 Inclination 1
Program 3
00:00 Speed 3 Inclination 6
Program 4
00:00 Speed 3 Inclination 6
Program 5
00:01 Speed 3 Inclination 6
00:06 Speed 3 Inclination 6
Program 6
00:01 Speed 3 Inclination 6
00:07 Speed 3 Inclination 6
Program 7
00:02 Speed 2 Inclination 1
00:15 Speed 2 Inclination 2
00:33 Speed 3 Inclination 1
01:02 Speed 0 Inclination 3
02:30 Speed 3 Inclination 3
04:30 Speed 3 Inclination 6
05:00 Speed 4 Inclination 2
06:15 Speed 5 Inclination 2
08:00 Speed 6 Inclination 2
08:45 Speed 7 Inclination 2
09:30 Speed 7 Inclination 3
10:10 Speed 3 Inclination 5
10:40 Speed 3 Inclination 7
11:02 Speed 2 Inclination 3
11:41 Speed 1 Inclination 3
12:15 Speed 0 Inclination 0
Program 8
00:01 Speed 2 Inclination 1
00:14 Speed 2 Inclination 2
00:32 Speed 3 Inclination 1
01:01 Speed 0 Inclination 3
02:29 Speed 3 Inclination 3
04:29 Speed 3 Inclination 6
04:59 Speed 4 Inclination 2
06:14 Speed 5 Inclination 2
07:59 Speed 6 Inclination 2
08:44 Speed 7 Inclination 2
09:29 Speed 7 Inclination 3
10:09 Speed 3 Inclination 5
10:39 Speed 3 Inclination 7
11:01 Speed 2 Inclination 3
11:40 Speed 1 Inclination 3
12:14 Speed 0 Inclination 0
Program 9
00:02 Speed 2 Inclination 1
00:14 Speed 2 Inclination 2
00:33 Speed 3 Inclination 1
01:02 Speed 0 Inclination 3
02:30 Speed 3 Inclination 3
04:29 Speed 3 Inclination 6
05:00 Speed 4 Inclination 2
06:15 Speed 5 Inclination 2
08:00 Speed 6 Inclination 2
08:45 Speed 7 Inclination 2
09:29 Speed 7 Inclination 3
10:10 Speed 3 Inclination 5
10:40 Speed 3 Inclination 7
11:02 Speed 2 Inclination 3
11:41 Speed 1 Inclination 3
12:15 Speed 0 Inclination 0

249
d/treadin.sample Executable file
View File

@ -0,0 +1,249 @@
11
7 1 2 3 3 6 9 1 1 5 5 1 9 1 9 1 9 4 5 5 4 0 9 1 8 0 1 0 1 3
3 5 4 0 9 4 5 4 4 1 9 5 4 4 4 5 5 5 3 2 7 8 10
5 2 6 5 5 3 4 4 5 1 9 5 4 0 9 5 4 1 8 5 5 4 4 3 5 4 6 4 7 6
4 4 6 4 4 4 5 5 4 4 5 6 4 6 4 4 4 1 8 5 5 0 8 4 5 5 5 1 8 4
4 4 4 6 4 5 4 4 6 4 6 2 4 5 6 4 6 5 4 5 4 5 4 5 2 6 4 4 5 5
7 7 3 4 4 5 5 5 6 6 5 5 5 0 9 0 9 1 9 5 4 1 8 4 5 4 5 6 4 4
4 8 7 5 3 4 4 2 4 6 8 7 5 4 6 5 7 6 10
7 1 2 3 3 6 9 1 1 5 5 1 9 1 9 1 9 4 5 5 4 0 9 1 8 0 1 0 1 3
3 5 4 0 9 4 5 4 4 1 9 5 4 4 4 5 5 5 3 2 7 8 10
5 2 6 5 5 3 4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 4 5 4 6 6 7 5 4 3 5 5 6 6 7 5 7
3 4 4 0 8 0 8 0 9 5 5 0 8 1 8 1 8 4 2 3 5 2 4 1 5 2 3 4 5 5
3 6 4 3 6 6 4 5 6 5 3 6 2 3 4 6 7 6 6 0 5 6 1 7 2 4 5 4 4 3
2 1 5 1 5 6 5 4 5 0 8 5 5 0 8 5 4 0 8 1 9 5 4 3 4 5 5 6 7 5
4 5 2 7 5 5 4 4 4 5 3 5 3 5 5 4 4 6 4 3 6 5 3 5 5 4 4 3 5 6
3 4 4 5 4 2 7 3 6 5 4 6 5 4 6 5 2 4 7 5 4 5 3 5 4 3 3 5 4 7
4 6 5 3 3 3 4 5 6 5 7 4 4 8 8 2 3 0 5 3 3 5 4 1 1 2 5 3 1 7
3 6 4 4 5 4 0 9 1 8 4 4 4 5 0 9 1 9 4 4 8 2 4 3 3 4 4 2 5 2
0 5 5 4 3 6 7 4 6 5 5 3 4 4 4 6 4 4 7 3 3 7 3 4 5 3 3 7 1 4
4 6 3 5 4 4 6 7 3 5 5 2 5 4 3 3 2 4 4 0 6 6 3 7 5 3 5 6 6 3
8 5 4 5 3 4 3 8 5 3 4 6 5 4 5 4 4 4 0 8 4 5 4 4 4 4 4 5 4 4
4 4 2 4 5 4 3 5 2 3 4 7 2 4 6 5 5 6 1 4 8 3 2 6 6 4 7 3 3 3
5 5 10

153
e/mines.cpp Executable file
View File

@ -0,0 +1,153 @@
#include <fstream>
#include <iostream>
using namespace std;
#define UNCOV 4
#define FLG 5
#define COV 6
#define MINE 9
int board[40][40], flags[40][40], visited[40][40];
int getInfo(int rows, int cols, int x, int y, int type) {
int count = 0;
if( x-1 >= 0 ){
if( y-1 >= 0 && board[x-1][y-1] == type) { count++; }
if( y+1 < rows && board[x-1][y+1] == type) {count++; }
if(board[x-1][y] == type) { count++; }
}
if( x+1 < cols ){
if( y-1 >= 0 && board[x+1][y-1] == type) { count++; }
if( y+1 < rows && board[x+1][y+1] == type) {count++; }
if(board[x+1][y] == type) { count++; }
}
if( y-1 >= 0 ){
if(board[x][y-1] == type) { count++; }
}
if( y+1 < rows ){
if(board[x][y+1] == type) { count++; }
}
return count;
}
int checkSquares(int rows, int cols) {
int count=0;
for(int i=0; i<rows; i++) {
for(int j=0; j<cols; j++) {
if(flags[i][j] == COV) { count++; }
}
}
return count;
}
int checkPath(int rows, int cols, int x, int y) {
visited[x][y] = true;
//for each uncovered square
int f = getInfo(rows, cols, x, y, FLG);
int c = getInfo(rows, cols, x, y, COV);
int m = getInfo(rows, cols, x, y, MINE);
if( f == m ) {
//uncover adjecent cells
if( x-1 >= 0 )
if(flags[x-1][y] != FLG ) { flags[x-1][y] = UNCOV; }
if( x+1 < cols )
if(flags[x+1][y] != FLG) { flags[x+1][y]= UNCOV; }
if( y-1 >= 0 )
if(flags[x][y-1] != FLG) { flags[x][y-1] = UNCOV; }
if( y+1 < rows )
if(flags[x][y+1] != FLG) { flags[x][y+1] = UNCOV;}
}
if( f + c == m) {
//flag all covered cells
if( x-1 >= 0 )
if(flags[x-1][y] != UNCOV ) { flags[x-1][y] = FLG; }
if( x+1 < cols )
if(flags[x+1][y] != UNCOV) { flags[x+1][y]= FLG; }
if( y-1 >= 0 )
if(flags[x][y-1] != UNCOV) { flags[x][y-1] = FLG; }
if( y+1 < rows )
if(flags[x][y+1] != UNCOV) { flags[x][y+1] = FLG;}
}
for(int i=0; i<rows; i++) {
for(int j=0; j<cols; j++) {
if( flags[i][j] == UNCOV && visited[i][j] == false ) {
//recursion
return checkPath(rows, cols, i, j);
}
}
}
return checkSquares(rows,cols);
return 1;
}
int main() {
ifstream in("mines.in");
ofstream out("mines.out");
char temp;
while(!in.eof()){
int rows, cols;
in >> rows;
in >> cols;
if( rows == 0 || cols == 0) { exit(0); }
cout << rows << " -- " << cols << endl;
for(int i=0; i<rows; i++) {
for(int j=0; j<cols; j++) {
in >> temp;
int a;
switch(temp) {
case '.':
a=0;
break;
case 'M':
a=MINE;
break;
default:
a = (int) temp;
}
board[i][j] = a;
}
}//end nested for
//debug
for(int i=0; i<rows; i++) {
for(int j=0; j<cols; j++) {
cout << getInfo(rows, cols, i, j, MINE);
}
cout << endl;
}
int minsqur = rows * cols;
for(int i=0; i<rows; i++) {
for(int j=0; j<cols; j++) {
//array we need
for(int a=0; a< rows; a++) {
for(int b=0; b<cols; b++) {
flags[a][b] = COV;
}
}
//another array we need
for(int a=0; a< rows; a++) {
for(int b=0; b<cols; b++) {
visited[a][b] = false;
}
}
//actual recursive call
if(board[i][j] != MINE) {
int c = checkPath(rows, cols, i, j);
if( c < minsqur ) { minsqur = c; }
}
}
}
out << minsqur << endl;
}//end while(!eof)
}//end main

13
e/mines.in Executable file
View File

@ -0,0 +1,13 @@
3 3
...
...
MM.
7 5
.....
.....
MMM..
M.M..
MMM..
.....
.....
0 0

2
e/mines.out Executable file
View File

@ -0,0 +1,2 @@
3
9

36
f/doubles.cpp Executable file
View File

@ -0,0 +1,36 @@
#include <fstream>
#include <iostream>
using namespace std;
int main() {
ifstream infile("doubles.in");
ofstream outfile ("doubles.out");
int innum, count;
infile >> innum;
while(innum != -1) {
int size=0;
int set[15];
while(innum != 0) {
set[size++] = innum;
infile >> innum;
}
int count = 0;
for(int x=0; x<size; x++) {
for (int y=0; y<size; y++) {
if( set[x] == set[y] * 2 ) {
count++;
break;
}
}
}
outfile << count << endl;
infile >> innum;
}
outfile.flush();
outfile.close();
exit(0);
}

4
f/doubles.in Executable file
View File

@ -0,0 +1,4 @@
1 4 3 2 9 7 18 22 0
2 4 8 10 0
7 5 11 13 1 3 0
-1

3
f/doubles.out Executable file
View File

@ -0,0 +1,3 @@
3
2
0

6
f/input.txt Executable file
View File

@ -0,0 +1,6 @@
1
2
2
3
4
5

799
fax/fax.in Executable file
View File

@ -0,0 +1,799 @@
8 10 10
0 1 1 1 1 1 1 1 1 56
5 8 8
1 2 1 2 3 3 1 2
7 21 8
0 7 2 4 3 1 1 1
3 1 2 1 6 1 13 1
3 1 1 3 1
80 10 10
0 10 10 10 10 10 10 10 10 560
50 8 8
10 20 10 20 30 30 10 20
70 21 8
0 70 20 40 30 10 10 10
30 10 20 10 60 10 130 10
30 10 10 30 10
4 1 1
12
1 2 2
0 1
9 21 21
0 7 1 1 1 6 4 6 3 6 2 6 3 6 4 6 3 6 2 6 2
17 36 36
0 17 1 3 1 3 1 3 1 3 3 1 3 1 3 1 3 1 70 1 3 1 3 1 3 1 3 3 1 3 1 3 1 3 1 2
17 128 30
0 1 2 2 2 2 2 2 2 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
43 71 30
0 43 1 42 2 41 3 39 5 1 1 35 9 33 11 31 13 29 15 13 1 13 17 11 3 11 19 2 2 3
1 1 5 9 20 2 2 3 7 8 20 9 8 5 20 11 7 5 19 13 3 9 17 15 1 11 15 29 13 31
11 33 9 35 7 37 5 39 3 41 1
55 107 30
0 55 1 53 3 51 5 22 2 25 7 19 4 1 8 12 12 19 7 5 2 9 1 2 13 4 4 2 9 1
2 1 1 6 5 2 2 2 11 1 4 2 4 2 4 1 4 1 3 1 8 4 4 1 1 1 8 1 3 2
4 7 2 1 7 2 2 8 1 1 3 2 11 8 1 5 1 1 5 1 2 2 1 2 1 3 1 10 10 10
5 3 4 1 4 4 3 12 7 22 3 24 5 51 3 53 1
25 17 16
24 24 24 24 24 24 24 24 24 24 24 24 24 24 24 24
16
40 753 30
0 1 3 4 3 1 1 3 1 5 1 1 3 10 2 1 3 1 1 1 2 1 1 1 2 2 3 1 1 3
1 2 3 2 2 1 3 2 1 3 4 1 1 1 2 5 1 1 2 2 1 1 1 1 4 2 1 1 2 2
1 1 2 2 2 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1 8 4 1 1 1 6 4 1 1 3 2 2 6 5 3 2 4 1 1 2 2 1
3 2 1 2 1 2 1 3 2 1 2 1 2 2 6 1 3 4 1 6 1 3 1 6 1 2 1 1 2 2
1 1 1 2 1 5 2 1 1 1 2 1 2 3 2 1 2 1 3 1 4 2 1 2 2 5 4 1 2 1
1 1 2 3 1 1 4 1 5 1 2 2 1 3 2 9 4 4 4 1 1 3 3 1 1 4 1 1 3 3
1 1 2 1 5 3 3 2 1 1 1 1 1 3 1 3 1 1 5 1 3 1 3 2 2 1 3 1 1 1
2 4 7 1 4 1 1 1 4 8 1 2 1 1 3 2 2 1 3 2 1 4 2 3 1 1 1 1 3 2
1 4 1
1000000000 1000 8
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
1000000000 1000 8
0 1000000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
500000000 500000000 500000000 500000000 500000000 500000000 500000000 500000000
1 4 4
1000000000 1000000000 1000000000 1000000000
1000000000 1000 7
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
1 999 10
0 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000 1
1000000000 1 1000000000 1 1000000000 1 1000000000 1 1000000000
998000 1000 16
0 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 998000000
999000 1000 16
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000
1000 1000 1000 1000 1000 1000 1000 999000000
1000000000 801 8
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
999999999 999999999 999999999 999999999 999999999 999999999 999999999 999999999
800
-1

262
fax/fax.java Executable file
View File

@ -0,0 +1,262 @@
// 2003 ACM Mid-Central Regional Programming Contest
// Problem G: Fax Regions
// by Andy Harrington, Loyola University Chicago
/*
fax.java
Algorithm that shrinks the fax to one with sides O(runs) and calculate
components conventionally then
Problem: given fax width and run lengths, calculate the number of
connected components.
1. Process runs initially
a. dropping full rows of same
b. if 1+2k full rows of different, drop the first 2k of these rows,
remembering the previous row and k
2. Look at the increasing sequence of x coordinates where shifts between same
and different take place, and remap these x coordinates onto
0,1,2,....newWidth, maintaining the order.
3. Do the conversion to a grid that is at most 1*runs across by 4*runs.
4. Calculate connected components by a conventional recursive routine
5. In each case where 2k rows in a run of differences was removed, add
k * (number of sideways transitions between black and white across the
previous row)
to the number of components, to get the total.
The program prints reduced grids to the screen if they are small enough.
You may also test the direct algorithm on small datasets by running the
program with a commandline parameter. This displays the full grid
solutions and writes the output to a file smallFax.out as long as the
widths and heights are no more than 80.
*/
import java.io.*;
import java.util.*;
import java.awt.Point;
class fax {
static final int MAXWIDTH = 1000000000;
static final int END_INPUT = -1;
static final int MAX_RUNS = 1000;
static final int MAX_DATASETS = 25; // for testing
static final char EMPTY = '.';
static final char UNVISITED = '*';
static final String compLabel = // for screen display
"123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
static char[][] fillGrid(int h, int w, Point[] changeCoord, int runs) {
// fill grid of h rows and w columns so first and last rows are empty
// given the coordinates where sequences of sames and differents end
int x, y;
char grid[][] = new char[h][w];
for (x = 0; x < w; x++)
grid[h-1][x] = grid[0][x] = EMPTY; // extra first and last row empty
boolean matches = true;
int i = 0;
for (y = 1; y < h-1; y++)
for (x = 0; x < w; x++) {
if (changeCoord[i].x == x && changeCoord[i].y == y) {
matches = !matches;
i++;
}
grid[y][x] = matches ?
grid[y-1][x] : (char)(EMPTY + UNVISITED - grid[y-1][x]);
}
return grid;
}
static int countComps(char[][] grid) {
// return the numer of components in a grid of EMPTY and UNVISITED
int h = grid.length - 1;
int w = grid[0].length;
int x, y;
int comps = 0;
for (y = 1; y < h; y++)
for (x = 0; x < w; x++) {
if (grid[y][x] == UNVISITED) {
fillComp(grid, y, x, compLabel.charAt(comps % compLabel.length()));
comps++;
}
}
return comps;
}
static void fillComp(char[][] grid, int y, int x, char fillChar) {
// recursively fill the unvisited component including (x, y) with fillChar
grid[y][x] = fillChar;
if (grid[y-1][x] == UNVISITED) fillComp(grid, y-1, x, fillChar);
if (grid[y+1][x] == UNVISITED) fillComp(grid, y+1, x, fillChar);
if (x > 0 && grid[y][x-1] == UNVISITED) fillComp(grid, y, x-1, fillChar);
if (x < grid[0].length-1 && grid[y][x+1] == UNVISITED)
fillComp(grid, y, x+1, fillChar);
}
static PrintWriter makeOutput(String name) {
PrintWriter out = null;
try {
out = new PrintWriter(
new BufferedWriter(
new FileWriter(name)));
} catch(Exception e) {
System.out.println("can't open output");
}
return out;
}
public static void main(String[] arg) {
String FILE = "fax";
ACMIO in = new ACMIO(FILE + ".in");
PrintWriter out = makeOutput(FILE+".out");
if (arg.length > 0) {
smallFax();
return;
}
Point[] changeCoord = new Point[MAX_RUNS];
int datasets = 0;
int w = in.intRead();
while ( w != END_INPUT) { // one dataset per loop
datasets++;
int y = 1; // border at row 0
int x = 0;
int totRuns = in.intRead();
if (totRuns > MAX_RUNS) System.out.println("Error -- runs: " + totRuns +
" > " + MAX_RUNS + " :max runs");
in.intRead(); // ignore runs per line -- put in for Pascal
Vector delPairs = new Vector();
for (int runs = 0; runs < totRuns; runs++) {
int n = in.intRead();
if (runs % 2 == 0) { // run of same
if (n + x >= w) // never add more than one line
y++;
}
else { // run of different
int dy = (n+x)/w;
if (dy > 3) { // guarantees all different for 3 full rows
int killPairs = (dy/2) - 1;
delPairs.add(new int[] {y, killPairs});
dy -= 2*killPairs;
}
y += dy;
}
x = (x + n) % w;
changeCoord[runs] = new Point(x, y);
}
if (x > 0) System.out.println("Error -- ending x is not 0 but " + x);
// shift x coordinates so all x coordinates 0,1, ... w-1 (with new w)
Point[] sorted = (Point[])changeCoord.clone(); // shallow clone important
Arrays.sort(sorted, 0, totRuns,
new Comparator() {
public int compare(Object p1, Object p2) {
return ((Point)p1).x - ((Point)p2).x;
}
public boolean equals(Object p) {
return compare(this, p) == 0;
}
}
);
// testing line
System.out.println("Dataset " + datasets + ": Orig width : " + w);
int newX = 0, oldX = 0;
for (int i = 0; i < totRuns; i++) {
if (sorted[i].x > oldX) {
newX++;
oldX = sorted[i].x;
}
sorted[i].x = newX; // also changes element of changeCoord
}
w = newX + 1;
char[][] grid = fillGrid(y+1, w, changeCoord, totRuns);
int comps = countComps(grid);
//testing line
System.out.print("Reduced grid: " +
(y-1) + " X " + w + " with " + comps + " components");
for (int i = delPairs.size() - 1; i >= 0; i--) {
int[] pair = (int[])(delPairs.get(i));
y = pair[0];
int changes = 0;
for (x = 1; x < w; x++)
if (grid[y][x-1] != grid[y][x])
changes++;
comps += (changes+1)*pair[1];
}
System.out.println(", final total: " + comps); // testing line
printGrid(grid);
out.println(comps);
w = in.intRead();
} // end of dataset
if (datasets > MAX_DATASETS) System.out.println("Error -- datasets: " +
datasets + " > " + MAX_DATASETS + " : max runs"); //testing line
out.close();
}
// The rest of the class is only used for testing //////////////////////////
static void printGrid(char[][] g) {
System.out.println();
if (g.length > 80 || g[0].length > 80)
System.out.println("Skipping big grid");
else
for (int r = 1; r < g.length - 1; r++)
System.out.println(g[r]);
System.out.println();
}
// The last method smallFax is just to test small faxes with the obvious
// algorithm: it is activated if fax is run with a commandline parameter.
static void smallFax() {
ACMIO in = new ACMIO("fax.in");
PrintWriter out = makeOutput("smallFax.out");
int datasets = 0;
int w = in.intRead(); // next dataset
while ( w <= 80) { // stop at big dataset
datasets++;
int totRuns = in.intRead();
in.intRead(); // ignore runs per line -- put in for Pascal
char[][] grid = new char[82][w]; // assume will be small
for (int i = 0; i < w; i++)
grid[0][i] = EMPTY;
int y = 1; // border at row 0
int x = 0;
boolean matches = true;
for (int runs = 0; runs < totRuns; runs++) {
int n = in.intRead();
for ( ; n > 0 ; n--) {
grid[y][x] = matches ?
grid[y-1][x] : (char)(EMPTY + UNVISITED - grid[y-1][x]);
if (x == w-1) {
x = 0;
y++;
}
else x++;
}
matches = !matches;
}
if (x > 0) System.out.println("Error -- ending x is not 0 but " + x);
char[][] fullGrid = new char[y+1][];
System.arraycopy(grid, 0, fullGrid, 0, y);
fullGrid[y] = fullGrid[0];
int comps = countComps(fullGrid);
System.out.println("Small Dataset "+datasets+ ": " +comps+ " components");
printGrid(fullGrid);
out.println(comps);
w = in.intRead();
} // end of dataset
out.close(); // omits lines starting with first input width > 80
} // end smallFax testing alternative
}

23
fax/fax.out Executable file
View File

@ -0,0 +1,23 @@
32
2
3
32
2
3
0
1
2
2
7
5
8
36
58
250
1
1000000000
250
250
499499
499999
80200

8
t/tread.in Executable file
View File

@ -0,0 +1,8 @@
2
7 1 2 3 3 6 9 1 1 5 5 1 9 1 9 1 9 4 5 5 4 0 9 1 8 0 1 0 1 3
3 5 4 0 9 4 5 4 4 1 9 5 4 4 4 5 5 5 3 2 7 8 10
5 2 6 5 5 3 4 4 5 1 9 5 4 0 9 5 4 1 8 5 5 4 4 3 5 4 6 4 7 6
4 4 6 4 4 4 5 5 4 4 5 6 4 6 4 4 4 1 8 5 5 0 8 4 5 5 5 1 8 4
4 4 4 6 4 5 4 4 6 4 6 2 4 5 6 4 6 5 4 5 4 5 4 5 2 6 4 4 5 5
7 7 3 4 4 5 5 5 6 6 5 5 5 0 9 0 9 1 9 5 4 1 8 4 5 4 5 6 4 4
4 8 7 5 3 4 4 2 4 6 8 7 5 4 6 5 7 6 10

90
t/tread.java Executable file
View File

@ -0,0 +1,90 @@
import java.io.*;
import java.util.regex.*;
import java.util.*;
import java.lang.Math;
import java.text.NumberFormat;
public class tread {
final static String end = "10";
public static void chirp ( int tokencount, StringTokenizer token, PrintWriter out ) {
int time = 0, incline = 0;
String one = token.nextToken();
String two = token.nextToken();
for ( int c = 0; c < 3; c++ ) {
if ( (one.equals ( "0" ) || one.equals ( "1" )) && (two.equals ( "8" ) || two.equals ( "9" )) ) {
time += Math.pow ( 2, c );
}
one = token.nextToken();
two = token.nextToken();
}
for ( int c = 0; c < 3; c++ ) {
if ( (one.equals ( "0" ) || one.equals ( "1" )) && (two.equals ( "8" ) || two.equals ( "9" )) ) {
incline += Math.pow ( 2, c );
}
one = token.nextToken();
two = token.nextToken();
}
try {
NumberFormat f = NumberFormat.getIntegerInstance();
f.setMinimumIntegerDigits ( 2 );
int minutes = (int)Math.floor ( tokencount / 180 );
int seconds = (int)Math.floor ( (tokencount - 1) % 180 / 3 ) - 1;
out.println ( f.format ( minutes ) + ":" + f.format ( seconds ) + " Speed " + time + " Inclination " + incline );
}
catch ( Exception e ) {e.printStackTrace();}
}
public static void main ( String[] args ) {
BufferedReader input;
PrintWriter output;
int programs = 0;
try {
input = new BufferedReader ( new FileReader ( "tread.in") );
output = new PrintWriter ( new FileOutputStream ( "tread.out" ) );
programs = Integer.parseInt ( input.readLine() );
for ( int count = 1; count <= programs; count++ ) {
output.println ( "Program " + count );
String line = input.readLine();
while ( !line.endsWith ( end ) ) {
line += " " + input.readLine();
}
StringTokenizer token = new StringTokenizer ( line );
int tokencount = token.countTokens();
String current = token.nextToken();
while ( tokencount - 16 >= tokencount - token.countTokens() ) {
if ( current.equals ( "4" ) || current.equals ( "5" ) ) {
StringTokenizer mytoke = new StringTokenizer ( line );
int ttemp = token.countTokens() + 1;
for ( int f = mytoke.countTokens(); f <= ttemp; f-- ) {mytoke.nextToken();}
String temp = mytoke.nextToken();
if ( temp.equals ( "4" ) || temp.equals ( "5" ) ) {
String token1 = "", token2 = "";
token1 = mytoke.nextToken();
if ( token1.equals ( "0" ) || token1.equals ( "1" ) ) {
token2 = mytoke.nextToken();
if ( token2.equals ( "8" ) || token2.equals ( "9" ) ) {
chirp ( tokencount - mytoke.countTokens(), mytoke, output );
while ( token.countTokens() != mytoke.countTokens() ) {token.nextToken();}
}
}
}
}
if ( token.hasMoreTokens() ) {current = token.nextToken();}
else {break;}
}
}
output.flush();
output.close();
}
catch ( Exception e ) {e.printStackTrace();}
}
}

0
t/tread.out Executable file
View File