#include "light.h"
#include <bits/stdc++.h>
using namespace std;
const int ADD = 80;
long long slaves;
void prepare(){
	slaves = 1;
}
vector<long long> getLight() {
    vector<long long> light;
    for ( int l = 0; (1LL << l) < slaves; l++ )
        light.push_back( slaves - (1 << l) + 1 );
    for ( int i = 1; i <= ADD && i <= slaves; i++ )
        light.push_back( i );
    sort( light.begin(), light.end() );
    light.resize( unique( light.begin(), light.end() ) - light.begin() );
    return light;
}
pair<long long, vector<long long>> join( long long p ) {
    slaves += p;
    return { p, getLight() };
}
pair<long long, vector<long long>> leave( long long p ) {
    slaves -= p;
    return { p, getLight() };
}
| # | 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... |