Oar Tester
Time limit1sMemory limit512 MB
Assign each of n oar types a positive integer strength so every pair sums to at most x_ij and at least one of the two reaches y_ij.
- Level
Medium7 of 10
- Topics
- Graph, Shortest path, Greedy
- Solved
- No attempts yet
Problem
There are n oar types. For every pair (i,j), the sum of their strengths is at most x_ij, and at least one of them is at least y_ij. Output any array of positive strengths that satisfies all constraints.
Input
The first line contains n. The next n lines hold matrix x, then a blank line, then n lines for matrix y.
Output
Print n positive integers separated by spaces.