diff --git a/cutthenegativity.py b/cutthenegativity.py new file mode 100644 index 0000000..5e39218 --- /dev/null +++ b/cutthenegativity.py @@ -0,0 +1,14 @@ +n = int(input()) + +output = [] +row = 1 +for _ in range(n): + costs = map(int, input().split()) + for col, cost in enumerate(costs, start=1): + if cost >= 0: + output.append([row, col, cost]) + row += 1 +print(len(output)) +for m in output: + u, v, c = map(str, m) + print(" ".join((u, v, c)))