Page 1 of 1

12255 - Underwater Snipers

Posted: Fri Sep 12, 2014 12:19 am
by brianfry713
Use this thread to discuss this problem.

Re: 12255 - Underwater Snipers

Posted: Tue Dec 18, 2018 2:12 pm
by metaphysis
Test data generator.

Code: Select all

#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[])
{
    srand(time(NULL));

    int T = 100;
    cout << T << "\n\n";
    for (int cs = 1; cs <= T; cs++)
    {
        long long k, N, S, D, x, y;
        k = rand() % 100000000;
        if (rand() % 100 > 70) k *= -1;
        N = rand() % 1000 + 1;
        S = rand() % 1000 + 1;
        D = rand() % 1000000000 + 1;
        cout << k << ' ' << N << ' ' << S << ' ' << D << '\n';
        for (int i = 0; i < N; i++)
        {
            x = rand() % 100000000;
            if (rand() % 100 > 70) x *= -1;
            y = k + rand() % (100000000LL - k);
            cout << x << ' ' << y << '\n';
        }
        cout << '\n';
    }

    return 0;
}