#include <sys/time.h>
#include <bits/stdc++.h>
using namespace std;

#define MAX_TIMER_NUM 256
static double s_tmptime[MAX_TIMER_NUM] = {}; // [s]
void stopwatch_start(int index)
{
    if (index >= MAX_TIMER_NUM) {
        cout << "INVALID TIMER NUM, IGNORED: MAX_TIMER_NUM is " << MAX_TIMER_NUM<< endl;
        return;
    }
    struct timeval tim;  
    gettimeofday(&tim, NULL);  
    s_tmptime[index] = tim.tv_sec+(tim.tv_usec / 1000000.0);  
}

double stopwatch_end(int index)
{
    if (index >= MAX_TIMER_NUM) {
        cout << "INVALID TIMER NUM, IGNORED: MAX_TIMER_NUM is " << MAX_TIMER_NUM<< endl;
        return -1;
    }
    struct timeval tim;  
    gettimeofday(&tim, NULL);  
    return tim.tv_sec+(tim.tv_usec / 1000000.0) - s_tmptime[index];
}

double get_clock_now(void)
{
    struct timeval tv;
    gettimeofday(&tv, NULL);
    return tv.tv_sec + (double)tv.tv_usec*1e-6;
}


#define rep(i,n) for(int i = 0; i < n; i++)
#define ll long long
vector<ll> a;
vector<ll> b;
int main(void) {
    for (ll cycle = 1; cycle <= 10000000; cycle *= 10) {
        cout << cycle << " ";

        {
            stopwatch_start(0);
            rep(i, cycle) {
                a.push_back(i);
            }
            double t = stopwatch_end(0);
            cout << t << " ";
            a.clear();
        }

        {
	        b.reserve(cycle);
            stopwatch_start(0);
            rep(i, cycle) {
                b.push_back(i);
            }
            double t = stopwatch_end(0);
            cout << t << " ";
	        b.clear();
        }
        cout << endl;
    }

    return 0;
}
