23 lines
546 B
Python
23 lines
546 B
Python
from itertools import islice, permutations
|
|
from random import randint, sample
|
|
|
|
N, L, B = 1000, 5000, 100_000_000
|
|
S = D = 0
|
|
while S == D:
|
|
S, D = randint(1, N), randint(1, N)
|
|
|
|
pairs = sample(list(permutations(range(N), r=2)), L)
|
|
rows = []
|
|
|
|
for a, b in pairs:
|
|
x = randint(1, B)
|
|
y = randint(x, B)
|
|
|
|
rows.append((a, b, x, y))
|
|
|
|
with open('test/security/nonsense.in', 'w') as f:
|
|
f.writelines(' '.join(map(str, tup)) + '\n' for tup in [(N, L, B), (S, D)] + rows)
|
|
|
|
with open('test/security/nonsense.ans', 'w') as f:
|
|
f.write('27\n')
|