1 import java
.util
.Scanner
;
2 import java
.util
.Arrays
;
4 import java
.io
.FileNotFoundException
;
5 import java
.io
.PrintWriter
;
7 public class inspection_pm
{
9 private static int[][] f
;
10 private static boolean[] z
;
12 private static int nn
;
13 private static int[][] c
;
14 private static int[][] aa
;
16 public static void main(String
[] args
) throws FileNotFoundException
{
17 Scanner in
= new Scanner(new File("inspection.in"));
18 PrintWriter out
= new PrintWriter("inspection.out");
21 boolean[][] a
= new boolean[n
][n
];
22 for (int i
= 0; i
< n
; i
++) {
24 for (int j
= 0; j
< k
; j
++) {
30 boolean[][] b
= new boolean[n
][n
];
31 for (int i
= 0; i
< n
; i
++) {
32 System
.arraycopy(a
[i
], 0, b
[i
], 0, n
);
34 for (int i
= 0; i
< n
; i
++) {
35 for (int j
= 0; j
< n
; j
++) {
36 for (int k
= 0; k
< n
; k
++) {
37 b
[j
][k
] = b
[j
][k
] || b
[j
][i
] && b
[i
][k
];
43 for (int i
= 0; i
< n
; i
++) {
44 for (int j
= 0; j
< n
; j
++) {
57 for (int i
= 0; i
< n
; i
++) {
62 c
[i
+ 2 + n
][1] = d
[i
];
66 for (int i
= 0; i
< n
; i
++) {
67 for (int j
= 0; j
< n
; j
++) {
69 c
[i
+ 2][j
+ 2 + n
] = 1000000000;
76 Arrays
.fill(z
, false);
81 for (int i
= 0; i
< n
; i
++) {
82 for (int j
= 0; j
< n
; j
++) {
83 if (a
[i
][j
]) aa
[i
][j
] = 1;
88 for (int i
= 0; i
< n
; i
++) {
89 for (int j
= 0; j
< n
; j
++) {
90 for (int k
= 0; k
< f
[i
+ 2][j
+ 2 + n
]; k
++) {
91 Arrays
.fill(z
, false);
93 System
.out
.println("!!!");
102 for (int i
= 0; i
< n
; i
++) {
109 for (int kk
= 0; kk
< n
; kk
++) {
129 private static boolean addPath(int i
, int j
) {
130 if (z
[i
]) return false;
135 for (int x
= 0; x
< n
; x
++) if (aa
[i
][x
] > 0) {
144 private static boolean dfs(int i
) {
145 if (z
[i
]) return false;
150 for (int j
= 0; j
< nn
; j
++) {
151 if (f
[i
][j
] < c
[i
][j
]) {