#ifndef STRUCT07_H_
#define STRUCT07_H_

#include <iostream>
using namespace std;

struct complex_number {
    double real;
    double imaginary;
};

istream& operator>>(istream& is, complex_number& cpx);

enum complex_type{
    real,
    imaginary
};

struct Query{
    complex_type type;
    int index;
};

class Judge{
    public:
        void check_init(){
            if(init == 0){
                cout << "Please call the init function first!" << endl;
                exit(0);
            }
        }
        void init_f(int &N, int &Q, complex_number*& cpx, Query*& queries){
            cin >> N >> Q;
            cpx = new complex_number[N];
            queries = new Query[Q];
            for(int i = 0; i < N; i++){
                cin >> cpx[i];
            }
            for(int i = 0; i < Q; i++){
                int tp;
                cin >> queries[i].index >> tp;
                if(tp) queries[i].type = imaginary;
                else queries[i].type = real;
            }
            init = 1;
        }
    private:
        int init = 0;
};

Judge j;

void Init(int &N, int &Q, complex_number*& cpx, Query*& queries){
    j.init_f(N, Q, cpx, queries);
}

void Answer(double ans){
    j.check_init();
    cout << ans << endl;
}
#endif // STRUCT07_H_
