Training Times


General Statement:
Some training simulation systems automatically record the response time of their users in order to gauge the effectiveness of the training system. The goal is for the user to become faster at completing the simulation. There are times, however, when a user gets fatigued and starts becoming slower at completing the simulation. Your task is to write a program that can determine from a collection of two input recorded times if the user is improving.

Input:
The first line of the input is an integer n that represents the number of data collections that follow where each data collection is on a single line. Each data collection contains two integers x and y separated by a single space. The integers represent the first and second times (in milliseconds) of the users, respectively.

Output:
Your program should produce n lines of output (one for each data collection). If the second time is smaller than the first, then the user is getting faster. In this case, your program should print IMPROVING. Otherwise, the user is not improving, and your program should print NOT IMPROVING.
The output is to be formatted exactly like that for the sample output given below.

Assumptions:
The value of n will be between 1 and 100, inclusive.
Each input integer will be between 0 and 1,000,000, inclusive.

Sample Input:
3
500 450
1000 1001
75 75

Sample Output:
IMPROVING
NOT IMPROVING
NOT IMPROVING

#include <stdio.h>

int main ()
{
    int dataset;
    scanf ("%d", &dataset);

    while ( dataset--) {
        int first;
        int second;

        scanf ("%d %d", &first, &second);

        if ( second < first )
            printf ("IMPROVING\n");

        else
            printf ("NOT IMPROVING\n");
    }

    return 0;
}

2 thoughts on “Training Times

  1. Judge’s Input :
    7
    99 100
    486 479
    0 0
    765432 765429
    4000 3999
    1234 1234
    777 99

    Judge’s Output :
    NOT IMPROVING
    IMPROVING
    NOT IMPROVING
    IMPROVING
    IMPROVING
    NOT IMPROVING
    IMPROVING

  2. #include
    int main(){
    int i,n,x,y;
    printf(“please enter the number of input lines: “);
    scanf(“%d”,&n);
    for(i=0;iy){printf(“IMPROVING\n”);}
    else{printf(“NOT IMPROVING\n”);}
    printf(“\n”);
    }
    return 0;
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s