import sys
from random import randint

f = open('input', 'w')

if (len(sys.argv) < 2):
    print('python3 generate_input.py <n>')
    sys.exit()

n = int(sys.argv[1])

f.write(str(n)+'\n')

for x in range(0, n):
    for y in range(0, n):
        if (y != 0):
            f.write(' ' + str(randint(0, 20) - 10))
        else:
            f.write(str(randint(0, 20) - 10))
    f.write('\n')

for x in range(0, n):
    for y in range(0, n):
        if (y != 0):
            f.write(' ' + str(randint(0, 20) - 10))
        else:
            f.write(str(randint(0, 20) - 10))
    f.write('\n')

f.close()

import sys
from random import randint

f = open('input', 'w')

if (len(sys.argv) < 2):
    print('python3 generate_input.py <nlines> <ncolums>')
    sys.exit()

nl = int(sys.argv[1])
nc = int(sys.argv[2])

f.write(str(nl)+'\n')
f.write(str(nc)+'\n')

for x in range(0, nl):
    for y in range(0, nc):
        if (y != 0):
            f.write(' ' + str(randint(0, 20) - 10))
        else:
            f.write(str(randint(0, 20) - 10))
    f.write('\n')

for x in range(0, nl):
    for y in range(0, nc):
        if (y != 0):
            f.write(' ' + str(randint(0, 20) - 10))
        else:
            f.write(str(randint(0, 20) - 10))
    f.write('\n')

f.close()

Add variable lines and columns
Add variable lines and columns

  import sys
  from random import randint
  
  f = open('input', 'w')
  
  if (len(sys.argv) < 2):
-     print('python3 generate_input.py <n>')
+     print('python3 generate_input.py <nlines> <ncolums>')
      sys.exit()
  
- n = int(sys.argv[1])
+ nl = int(sys.argv[1])
+ nc = int(sys.argv[2])
  
- f.write(str(n)+'\n')
+ f.write(str(nl)+'\n')
+ f.write(str(nc)+'\n')
  
- for x in range(0, n):
+ for x in range(0, nl):
-     for y in range(0, n):
+     for y in range(0, nc):
          if (y != 0):
              f.write(' ' + str(randint(0, 20) - 10))
          else:
              f.write(str(randint(0, 20) - 10))
      f.write('\n')
  
- for x in range(0, n):
+ for x in range(0, nl):
-     for y in range(0, n):
+     for y in range(0, nc):
          if (y != 0):
              f.write(' ' + str(randint(0, 20) - 10))
          else:
              f.write(str(randint(0, 20) - 10))
      f.write('\n')
  
  f.close()
  
Add variable lines and columns
## Code Before:
import sys
from random import randint

f = open('input', 'w')

if (len(sys.argv) < 2):
    print('python3 generate_input.py <n>')
    sys.exit()

n = int(sys.argv[1])

f.write(str(n)+'\n')

for x in range(0, n):
    for y in range(0, n):
        if (y != 0):
            f.write(' ' + str(randint(0, 20) - 10))
        else:
            f.write(str(randint(0, 20) - 10))
    f.write('\n')

for x in range(0, n):
    for y in range(0, n):
        if (y != 0):
            f.write(' ' + str(randint(0, 20) - 10))
        else:
            f.write(str(randint(0, 20) - 10))
    f.write('\n')

f.close()

## Instruction:
Add variable lines and columns
## Code After:
import sys
from random import randint

f = open('input', 'w')

if (len(sys.argv) < 2):
    print('python3 generate_input.py <nlines> <ncolums>')
    sys.exit()

nl = int(sys.argv[1])
nc = int(sys.argv[2])

f.write(str(nl)+'\n')
f.write(str(nc)+'\n')

for x in range(0, nl):
    for y in range(0, nc):
        if (y != 0):
            f.write(' ' + str(randint(0, 20) - 10))
        else:
            f.write(str(randint(0, 20) - 10))
    f.write('\n')

for x in range(0, nl):
    for y in range(0, nc):
        if (y != 0):
            f.write(' ' + str(randint(0, 20) - 10))
        else:
            f.write(str(randint(0, 20) - 10))
    f.write('\n')

f.close()
