#include <bits/stdc++.h>
#include "light.h"
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2")
#define int long long
#define pii pair<int,int> 
#define vi vector<int>
#define ff first
#define ss second
#define sp << " " << 
#define all(x) x.begin(),x.end()
using namespace std;
const int MOD = 1e9+7;
int cnt = 1;
void prepare(){
	cnt = 1;
}
std::pair<int, std::vector<int>> join(int p){
	vi torches;
	cnt+=p;
	int cur = cnt;
	torches.push_back(cur);
	cur--;
	while (cur > 1) {
		torches.push_back(cur);
		cur = cnt-(cnt-cur)*2;
	}
	torches.push_back(1);
	reverse(all(torches));
	return {p,torches};
}
std::pair<int, std::vector<int>> leave(int p){
	cnt-=p;
	int cur = cnt;
	vi torches;
	torches.push_back(cur);
	cur--;
	while (cur > 1) {
		torches.push_back(cur);
		cur = cnt-(cnt-cur)*2;
	}
	torches.push_back(1);
	reverse(all(torches));
	return {p,torches};
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict | Execution time | Memory | Grader output | 
|---|
| Fetching results... |