#ifndef MAIN_H
#define MAIN_H

#include <vector>
#include <cstdio>
#include <cstdlib>
#include <iostream>


class State {
public:
    std::vector<int> heights;
    std::vector<std::vector<int>> stacks;
    int max_width;
    int max_height;
    int size;

    State(std::vector<int> heights, int height, int _size);
    void apply_perm(std::vector<int> perm);
    void relocate(int i1, int i2);
    void retrieve(int i);
    void print();
    State copy();
    std::pair<int,int> next_req();
    bool valid_move(int i, int j);
    int min_stack(int forbidden);
    int step_L(int i, int j);
};






#endif // MAIN_H