This page is still under construction.

Parts of this page are still being built. What you see may change.

The Eccentric Professor

Time limit1sMemory limit256 MB

Summary
Compare n times s against d plus n times p for each test case and print which option costs less.
Level

Easy1 of 10

Topics
Math, Implementation
Solved
No attempts yet

Problem

Seunghyuk is an eccentric professor. He believes that from now on, writing a computer program means writing it in parallel. To convince everyone that he is right, he prepared an experiment.

The experiment runs like this. He first picks a few problems and predicts how many times the program that solves each one will run over the next year. He then tells his assistant to develop a parallel version and measures how long that development takes. Finally, they measure the running time of the parallel version and of the serial version.

From the data he collected, Seunghyuk wants to know when parallelizing reduces the total amount of work. The work for one problem is the time spent developing the parallel version plus the time spent waiting for that program to run over the next year.

Input

The first line contains the number of test cases TT (T≤1000T \le 1000).

Each test case follows on its own line as four integers dd, nn, ss, pp separated by single spaces. dd (0≤d≤10000000 \le d \le 1000000) is the time it takes to develop the parallel version. nn (0≤n≤1000000 \le n \le 100000) is the number of times the program runs over the next year. ss and pp (0≤s,p≤10000 \le s, p \le 1000) are the running times of the serial version and of the parallel version.

Output

The serial version already exists, so it costs no development time. The work for the serial version is therefore n×sn \times s, and the work for the parallel version is d+n×pd + n \times p.

For each test case, print one line: parallelize if the work for the parallel version is smaller, do not parallelize if it is larger, and does not matter if the two values are equal. Print the words without the quotation marks.

Examples6

  1. Example 1

    Input
    3
    10 2 3 2
    20 5 8 2
    0 2 1 1
    
    Expected output
    do not parallelize
    parallelize
    does not matter
    
  2. Example 2

    Input
    1
    0 0 0 0
    
    Expected output
    does not matter
    
  3. Example 3

    Input
    3
    0 0 5 7
    5 0 1000 0
    1000000 0 0 1000
    
    Expected output
    does not matter
    do not parallelize
    do not parallelize
    
  4. Example 4

    Input
    3
    1000000 100000 1000 990
    1000000 100000 1000 989
    1000000 100000 1000 991
    
    Expected output
    does not matter
    parallelize
    do not parallelize
    
  5. Example 5

    Input
    4
    0 100000 0 0
    1 100000 0 0
    0 100000 0 1
    0 1 1000 999
    
    Expected output
    does not matter
    do not parallelize
    do not parallelize
    parallelize
    
  6. Example 6

    Input
    4
    10 5 3 1
    11 5 3 1
    9 5 3 1
    1000 1 1000 0
    
    Expected output
    does not matter
    do not parallelize
    parallelize
    does not matter