Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
goelp14
GitHub Repository: goelp14/easyctf-iv-problems
Path: blob/master/prog_count/generator.py
650 views
1
from random import randint as ri
2
from random import seed as ss
3
c = int(input())
4
5
def gc(n, s, lo, hi):
6
o = "{} {}\n".format(n, s)
7
o += ' '.join(str(ri(lo,hi)) for i in range(n))
8
return o
9
10
if c == 1:
11
print(gc(1, 7, 7, 7))
12
elif c == 2:
13
print(gc(6, 3, -3, 3))
14
elif c <= 4:
15
print(gc(20, 0, -1, 1))
16
elif c <= 6:
17
print(gc(10, 10, 0, 10))
18
elif c <= 10:
19
print(gc(20, ri(-50, 50), -100, -100))
20
elif c <= 12:
21
n, s = ri(10, 20), ri(20, 30)
22
print(gc(n, s, -15, 15))
23
elif c <= 15:
24
n, s = 20, ri(-50, 50)
25
print(gc(n, s, -50, 50))
26
else:
27
n, s = 20, ri(-10, 10)
28
print(gc(n, s, -10, 10))
29