// File: /workspace/github_cpp_makefile_star2_O2/Laakeri[P]Triangulator/src/setcover.cpp
// Function: SetCover::solve(std::vector<int, std::allocator<int>>, int, int)
vector<int> solve(vector<int> univ, int okCover_, int upperBound_) {
	git++;
	assert(hasInit);
	if (univ.size() == 0) return {};
	SCTimer1.start();
	okCover = okCover_;
	upperBound = upperBound_;
	assert(okCover <= upperBound);
	sort(univ.begin(), univ.end());
	univ.erase(unique(univ.begin(), univ.end()), univ.end());
	
	if (hasSol.count(univ) && (int)hasSol[univ].size() <= okCover) {
		return hasSol[univ];
	}
	if (noSol.count(univ) && noSol[univ] >= upperBound) {
		return {-1};
	}
	
	int n = univ.size();
	
	for (int i = 0; i < n; i++) {
		assert(univ[i] >= 0 && univ[i] < maxN);
		plc[univ[i]] = i;
		is[univ[i]] = git;
	}
	int m = 0;
	for (int i = 0; i < gm; i++) {
		sets[m].clear();
		for (int j = 0; j < (int)Gsets[i].size(); j++) {
			if (is[Gsets[i][j]] == git) {
				sets[m].push_back(plc[Gsets[i][j]]);
			}
		}
		if (sets[m].size() > 0) {
			for (int j = 0; j < (int)sets[m].size(); j++) {
				if (j > 0) assert(sets[m][j] > sets[m][j-1]);
				assert(sets[m][j] >= 0 && sets[m][j] < n);
			}
			m++;
		}
	}
	sort(sets, sets+m);
	auto last = unique(sets, sets+m);
	m = last - sets;
	assert(m <= gm);
	for (int i = 1; i < m; i++) {
		assert(sets[i] > sets[i-1]);
	}
	for (int i = 0; i < n; i++) {
		cnt[i] = 0;
	}
	for (int i = 0; i < m; i++) {
		for (int x : sets[i]) {
			cnt[x]++;
		}
	}
	for (int i = 0; i < n; i++) {
		assert(cnt[i] > 0);
		cc[i] = {cnt[i], i};
	}
	sort(cc, cc + n);
	for (int i = 0; i < n; i++) {
		um[cc[i].S] = i;
		where[i].clear();
	}
	for (int i = 0; i < m; i++) {
		for (int& x : sets[i]) {
			x = um[x];
			where[x].push_back(i);
		}
		sort(sets[i].begin(), sets[i].end());
	}
	for (int i = 0; i < n; i++) {
		for (int x : where[i]) {
			int f = 0;
			for (int j = 0; j < (int)sets[x].size(); j++) {
				if (sets[x][j] == i) {
					f = (int)sets[x].size() - j;
					break;
				}
			}
			assert(f > 0);
			heur[x] = f;
		}
		assert(cc[i].F == (int)where[i].size());
		auto cmp = [&](int a, int b) {
			return heur[a] > heur[b];
		};
		sort(where[i].begin(), where[i].end(), cmp);
	}
	for (int i = 0; i < m; i++) sel[i] = 0;
	opt.clear();
	cv.clear();
	if (hasSol.count(univ) && (int)hasSol[univ].size() <= upperBound) {
		opt = hasSol[univ];
		upperBound = opt.size();
	}
	SCTimer2.start();
	go(0, n);
	SCTimer2.stop();
	if (opt.size() == 0) {
		opt = {-1};
		noSol[univ] = upperBound;
	}
	else {
		if (hasSol.count(univ)) {
			if (opt.size() < hasSol[univ].size()) {
				hasSol[univ] = opt;
			}
		}
		else {
			hasSol[univ] = opt;
		}
	}
	SCTimer1.stop();
	return opt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
incl 0x1501f(%rip)           # 0x301c8
cmpb $0x0, 0xb86c94(%rip)    # 0xba1e44
je 0x1b96d
movq %rsi, %r13
movq %rdi, %r12
movq 0x8(%rsi), %rax
cmpq (%rsi), %rax
je 0x1b2e4
movl %ecx, %ebp
movl %edx, %r15d
leaq 0xb86c7b(%rip), %rdi    # 0xba1e50
callq 0x1e6c0
movl %r15d, 0xb86c67(%rip)   # 0xba1e48
movl %ebp, 0xb86c65(%rip)    # 0xba1e4c
cmpl %ebp, %r15d
jg 0x1b986
movq (%r13), %rdi
movq 0x8(%r13), %rsi
callq 0x8dde
movq (%r13), %rdi
movq 0x8(%r13), %rsi
callq 0x91de
movq 0x8(%r13), %rdx
movq %r13, %rdi
movq %rax, %rsi
callq 0x8818
leaq 0xb86c60(%rip), %rdi    # 0xba1e80
movq %r13, %rsi
callq 0x1c1d0
testq %rax, %rax
je 0x1b253
leaq 0xb86c4c(%rip), %rdi    # 0xba1e80
movq %r13, %rsi
callq 0x1c1ea
movq 0x8(%rax), %rcx
subq (%rax), %rcx
shrq $0x2, %rcx
cmpl %ecx, 0xb86bfb(%rip)    # 0xba1e48
jge 0x1b824
leaq 0xb86c56(%rip), %rdi    # 0xba1eb0
movq %r13, %rsi
callq 0x19714
testq %rax, %rax
je 0x1b284
leaq 0xb86c42(%rip), %rdi    # 0xba1eb0
movq %r13, %rsi
callq 0x1972e
movl (%rax), %eax
cmpl 0xb86bce(%rip), %eax    # 0xba1e4c
jge 0x1b83b
movq (%r13), %rax
movq 0x8(%r13), %rbp
subq %rax, %rbp
movq %rbp, 0x48(%rsp)
shrq $0x2, %rbp
movl 0x14f2a(%rip), %ecx     # 0x301c8
xorl %edx, %edx
testl %ebp, %ebp
movl $0x0, %esi
cmovgl %ebp, %esi
movq %rsi, 0x18(%rsp)
leaq 0x69130a(%rip), %rbx    # 0x6ac5c0
leaq 0x6c2043(%rip), %r14    # 0x6dd300
cmpq %rdx, 0x18(%rsp)
je 0x1b2f7
movl (%rax,%rdx,4), %esi
cmpq $0xc350, %rsi           # imm = 0xC350
jae 0x1b910
movl %edx, (%rbx,%rsi,4)
movslq (%rax,%rdx,4), %rsi
movl %ecx, (%r14,%rsi,4)
incq %rdx
jmp 0x1b2bd
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
andq $0x0, 0x10(%r12)
jmp 0x1b8a1
movq %r13, 0x38(%rsp)
movq %r12, 0x40(%rsp)
leaq 0xa00138(%rip), %r13    # 0xa1b440
xorl %edi, %edi
xorl %r8d, %r8d
movq %rbp, 0x30(%rsp)
movslq 0x62f817(%rip), %rcx    # 0x64ab30
movslq %r8d, %rax
cmpq %rcx, %rdi
jge 0x1b401
movl %r8d, 0x20(%rsp)
imulq $0x18, %rax, %rcx
leaq (%rcx,%r13), %rbp
movq (%rcx,%r13), %rax
cmpq %rax, 0x8(%rcx,%r13)
je 0x1b341
movq %rax, 0x8(%rbp)
movq %rdi, 0x8(%rsp)
imulq $0x18, %rdi, %r12
leaq 0x8db16f(%rip), %rax    # 0x8f64c0
addq %rax, %r12
xorl %r15d, %r15d
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
shrq $0x2, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r15
jge 0x1b390
movslq (%rax,%r15,4), %rax
movl (%r14,%rax,4), %ecx
cmpl 0x14e4b(%rip), %ecx     # 0x301c8
jne 0x1b38b
leaq (%rbx,%rax,4), %rsi
movq %rbp, %rdi
callq 0x6402
incq %r15
jmp 0x1b357
movq (%rbp), %rax
movq 0x8(%rbp), %rcx
subq %rax, %rcx
je 0x1b3ef
shrq $0x2, %rcx
testl %ecx, %ecx
movl $0x0, %edx
cmovlel %edx, %ecx
xorl %edx, %edx
movq 0x30(%rsp), %rbp
movq 0x8(%rsp), %rdi
movl 0x20(%rsp), %r8d
cmpq %rdx, %rcx
je 0x1b3ea
testq %rdx, %rdx
je 0x1b3d4
movl (%rax,%rdx,4), %esi
cmpl -0x4(%rax,%rdx,4), %esi
jg 0x1b3d6
jmp 0x1b8f1
movl (%rax), %esi
testl %esi, %esi
js 0x1b8d2
incq %rdx
cmpl %ebp, %esi
jl 0x1b3bc
jmp 0x1b8d2
incl %r8d
jmp 0x1b3f9
movq 0x8(%rsp), %rdi
movl 0x20(%rsp), %r8d
incq %rdi
jmp 0x1b312
imulq $0x18, %rax, %rbx
addq %r13, %rbx
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1d2e6
movq %r13, %rdi
movq %rbx, %rsi
callq 0x1d9d6
subq %r13, %rax
pushq $0x18
popq %rcx
cqto
idivq %rcx
movq %rax, %r12
cmpl %r12d, 0x62f6fd(%rip)   # 0x64ab30
jl 0x1b9a3
movslq %r12d, %rbx
xorl %r14d, %r14d
incq %r14
cmpq %rbx, %r14
jge 0x1b47d
leaq 0x18(%r13), %r15
leaq 0x18(%r13), %rsi
movq %r13, %rdi
callq 0x9fc0
movq %r15, %r13
testb %al, %al
jne 0x1b43f
leaq 0x6e77(%rip), %rdi      # 0x222dc
leaq 0x6d25(%rip), %rsi      # 0x22191
leaq 0x6dbd(%rip), %rcx      # 0x22230
movl $0xa6, %edx
callq 0x2150
movq 0x18(%rsp), %rax
leaq (,%rax,4), %rcx
xorl %edx, %edx
leaq 0x6603ed(%rip), %rax    # 0x67b880
cmpq %rdx, %rcx
je 0x1b4a2
andl $0x0, (%rdx,%rax)
addq $0x4, %rdx
jmp 0x1b493
xorl %ecx, %ecx
testl %r12d, %r12d
movl $0x0, %r8d
cmovgl %r12d, %r8d
leaq 0x9fff88(%rip), %r13    # 0xa1b440
cmpq %r8, %rcx
je 0x1b4e0
imulq $0x18, %rcx, %rsi
movq (%rsi,%r13), %rdx
movq 0x8(%rsi,%r13), %rsi
cmpq %rsi, %rdx
je 0x1b4db
movslq (%rdx), %rdi
incl (%rax,%rdi,4)
addq $0x4, %rdx
jmp 0x1b4ca
incq %rcx
jmp 0x1b4b8
xorl %ecx, %ecx
leaq 0x7545d7(%rip), %r14    # 0x76fac0
cmpq %rcx, 0x18(%rsp)
je 0x1b50c
movl (%rax), %edx
testl %edx, %edx
jle 0x1b92f
movl %edx, (%r14,%rcx,8)
movl %ecx, 0x4(%r14,%rcx,8)
incq %rcx
addq $0x4, %rax
jmp 0x1b4e9
movq %r8, 0x20(%rsp)
movq 0x48(%rsp), %rsi
shlq $0x1e, %rsi
sarq $0x1d, %rsi
addq %r14, %rsi
movq %r14, %rdi
callq 0x1da61
leaq 0x7b6018(%rip), %rax    # 0x7d1548
xorl %ecx, %ecx
leaq 0x723847(%rip), %rbx    # 0x73ed80
cmpq %rcx, 0x18(%rsp)
je 0x1b55d
movslq 0x4(%r14,%rcx,8), %rdx
movl %ecx, (%rbx,%rdx,4)
movq -0x8(%rax), %rdx
cmpq %rdx, (%rax)
je 0x1b554
movq %rdx, (%rax)
incq %rcx
addq $0x18, %rax
jmp 0x1b539
movq %r12, 0x8(%rsp)
xorl %eax, %eax
leaq 0x7b5fd5(%rip), %r14    # 0x7d1540
leaq 0x10(%rsp), %r12
movl %eax, 0x10(%rsp)
cmpl 0x8(%rsp), %eax
jge 0x1b5cc
cltq
imulq $0x18, %rax, %rax
movq (%rax,%r13), %r15
movq 0x8(%rax,%r13), %rbp
cmpq %rbp, %r15
je 0x1b5ad
movslq (%r15), %rax
movslq (%rbx,%rax,4), %rax
movl %eax, (%r15)
imulq $0x18, %rax, %rdi
addq %r14, %rdi
movq %r12, %rsi
callq 0x6402
addq $0x4, %r15
jmp 0x1b589
movslq 0x10(%rsp), %rax
imulq $0x18, %rax, %rax
movq (%rax,%r13), %rdi
movq 0x8(%rax,%r13), %rsi
callq 0x8dde
movl 0x10(%rsp), %eax
incl %eax
jmp 0x1b570
xorl %r15d, %r15d
leaq 0x6f2a6a(%rip), %rbp    # 0x70e040
cmpq 0x18(%rsp), %r15
movq 0x20(%rsp), %rdx
je 0x1b6c9
imulq $0x18, %r15, %rax
movq (%rax,%r14), %rdi
movq 0x8(%rax,%r14), %r12
movq %rdi, %rax
cmpq %r12, %rax
je 0x1b64d
movslq (%rax), %rcx
imulq $0x18, %rcx, %rdx
movq (%rdx,%r13), %rsi
movq 0x8(%rdx,%r13), %rdx
subq %rsi, %rdx
shrq $0x2, %rdx
testl %edx, %edx
movl $0x0, %r10d
cmovgl %edx, %r10d
xorl %r8d, %r8d
cmpq %r8, %r10
je 0x1b8b3
movl (%rsi,%r8,4), %r9d
cmpq %r9, %r15
je 0x1b638
incq %r8
jmp 0x1b621
subq %r8, %rdx
testl %edx, %edx
jle 0x1b8b3
movl %edx, (%rbp,%rcx,4)
addq $0x4, %rax
jmp 0x1b5f6
movq %r12, %rbx
subq %rdi, %rbx
movq %rbx, %rax
sarq $0x2, %rax
leaq 0x75445f(%rip), %rcx    # 0x76fac0
cmpl %eax, (%rcx,%r15,8)
jne 0x1b94e
cmpq %r12, %rdi
je 0x1b6c1
bsrq %rax, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %r12, %rsi
movq %rdi, 0x8(%rsp)
callq 0x1bf1f
cmpq $0x41, %rbx
jl 0x1b6b4
movq 0x8(%rsp), %rdi
leaq 0x40(%rdi), %rbx
movq %rbx, %rsi
callq 0x1c127
cmpq %r12, %rbx
je 0x1b6c1
movq %rbx, %rdi
callq 0x1c19e
addq $0x4, %rbx
jmp 0x1b6a1
movq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0x1c127
incq %r15
jmp 0x1b5d6
shlq $0x2, %rdx
xorl %eax, %eax
leaq 0x62f46a(%rip), %rcx    # 0x64ab40
movq 0x40(%rsp), %r12
movq 0x38(%rsp), %r14
movq 0x30(%rsp), %r15
cmpq %rax, %rdx
je 0x1b6f4
andl $0x0, (%rax,%rcx)
addq $0x4, %rax
jmp 0x1b6e5
movq 0x62f41d(%rip), %rax    # 0x64ab18
cmpq %rax, 0x62f41e(%rip)    # 0x64ab20
je 0x1b70b
movq %rax, 0x62f415(%rip)    # 0x64ab20
movq 0x62f3ee(%rip), %rax    # 0x64ab00
cmpq %rax, 0x62f3ef(%rip)    # 0x64ab08
je 0x1b722
movq %rax, 0x62f3e6(%rip)    # 0x64ab08
leaq 0xb86757(%rip), %rdi    # 0xba1e80
movq %r14, %rsi
callq 0x1c1d0
testq %rax, %rax
je 0x1b78e
leaq 0xb86743(%rip), %rdi    # 0xba1e80
movq %r14, %rsi
callq 0x1c1ea
movq 0x8(%rax), %rcx
subq (%rax), %rcx
shrq $0x2, %rcx
cmpl %ecx, 0xb866f6(%rip)    # 0xba1e4c
jl 0x1b78e
leaq 0xb86721(%rip), %rdi    # 0xba1e80
movq %r14, %rsi
callq 0x1c1ea
leaq 0x62f3aa(%rip), %rdi    # 0x64ab18
movq %rax, %rsi
callq 0x193e8
movq 0x62f3a3(%rip), %rax    # 0x64ab20
subq 0x62f394(%rip), %rax    # 0x64ab18
shrq $0x2, %rax
movl %eax, 0xb866be(%rip)    # 0xba1e4c
leaq 0xb866d3(%rip), %rbx    # 0xba1e68
movq %rbx, %rdi
callq 0x1e6c0
xorl %edi, %edi
movl %r15d, %esi
callq 0x1af6f
movq %rbx, %rdi
callq 0x1e6d8
movq 0x62f36a(%rip), %rax    # 0x64ab20
cmpq 0x62f35b(%rip), %rax    # 0x64ab18
je 0x1b855
leaq 0xb866b6(%rip), %rdi    # 0xba1e80
movq %r14, %rsi
callq 0x1c1d0
testq %rax, %rax
je 0x1b804
movq 0x62f342(%rip), %rbx    # 0x64ab20
subq 0x62f333(%rip), %rbx    # 0x64ab18
leaq 0xb86694(%rip), %rdi    # 0xba1e80
movq %r14, %rsi
callq 0x1c1ea
movq 0x8(%rax), %rcx
subq (%rax), %rcx
cmpq %rcx, %rbx
jae 0x1b886
leaq 0xb86675(%rip), %rdi    # 0xba1e80
movq %r14, %rsi
callq 0x1c1ea
leaq 0x62f2fe(%rip), %rsi    # 0x64ab18
movq %rax, %rdi
callq 0x193e8
jmp 0x1b886
leaq 0xb86655(%rip), %rdi    # 0xba1e80
movq %r13, %rsi
callq 0x1c1ea
movq %r12, %rdi
movq %rax, %rsi
jmp 0x1b89c
leaq 0x54(%rsp), %rsi
orl $-0x1, (%rsi)
pushq $0x1
popq %rdx
leaq 0x17(%rsp), %rcx
movq %r12, %rdi
callq 0xdbe8
jmp 0x1b8a1
leaq 0x30(%rsp), %rdx
orl $-0x1, -0x4(%rdx)
leaq 0x62f2b3(%rip), %rdi    # 0x64ab18
leaq 0x2c(%rsp), %rsi
callq 0x1dfa4
movl 0xb865d7(%rip), %ebx    # 0xba1e4c
leaq 0xb86634(%rip), %rdi    # 0xba1eb0
movq %r14, %rsi
callq 0x1972e
movl %ebx, (%rax)
leaq 0xb865c3(%rip), %rdi    # 0xba1e50
callq 0x1e6d8
leaq 0x62f27f(%rip), %rsi    # 0x64ab18
movq %r12, %rdi
callq 0x3896
movq %r12, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6a41(%rip), %rdi      # 0x222fb
leaq 0x68d0(%rip), %rsi      # 0x22191
leaq 0x6968(%rip), %rcx      # 0x22230
movl $0xc9, %edx
callq 0x2150
leaq 0x69d9(%rip), %rdi      # 0x222b2
leaq 0x68b1(%rip), %rsi      # 0x22191
leaq 0x6949(%rip), %rcx      # 0x22230
movl $0x9c, %edx
callq 0x2150
leaq 0x69a0(%rip), %rdi      # 0x22298
leaq 0x6892(%rip), %rsi      # 0x22191
leaq 0x692a(%rip), %rcx      # 0x22230
movl $0x9b, %edx
callq 0x2150
leaq 0x6962(%rip), %rdi      # 0x22279
leaq 0x6873(%rip), %rsi      # 0x22191
leaq 0x690b(%rip), %rcx      # 0x22230
movl $0x8d, %edx
callq 0x2150
leaq 0x69ba(%rip), %rdi      # 0x222f0
leaq 0x6854(%rip), %rsi      # 0x22191
leaq 0x68ec(%rip), %rcx      # 0x22230
movl $0xb1, %edx
callq 0x2150
leaq 0x69ac(%rip), %rdi      # 0x22301
leaq 0x6835(%rip), %rsi      # 0x22191
leaq 0x68cd(%rip), %rcx      # 0x22230
movl $0xcc, %edx
callq 0x2150
leaq 0x6815(%rip), %rdi      # 0x22189
leaq 0x6816(%rip), %rsi      # 0x22191
leaq 0x68ae(%rip), %rcx      # 0x22230
pushq $0x7a
jmp 0x1b99d
leaq 0x68d6(%rip), %rdi      # 0x22263
leaq 0x67fd(%rip), %rsi      # 0x22191
leaq 0x6895(%rip), %rcx      # 0x22230
pushq $0x7f
popq %rdx
callq 0x2150
leaq 0x692a(%rip), %rdi      # 0x222d4
leaq 0x67e0(%rip), %rsi      # 0x22191
leaq 0x6878(%rip), %rcx      # 0x22230
movl $0xa4, %edx
callq 0x2150