poj 3030 Nasty Hacks

来源:互联网 发布:vue.js event.target 编辑:程序博客网 时间:2024/06/05 02:28

Description

You are the CEO of Nasty Hacks Inc., a company that creates small pieces of malicious software which teenagers may use to fool their friends. The company has just finished their first product and it is time to sell it. You want to make as much money as possible and consider advertising in order to increase sales. You get an analyst to predict the expected revenue, both with and without advertising. You now want to make a decision as to whether you should advertise or not, given the expected revenues.

Input

The input consists of n cases, and the first line consists of one positive integer giving n. The next n lines each contain 3 integers, r, e and c. The first, r, is the expected revenue if you do not advertise, the second, e, is the expected revenue if you do advertise, and the third, c, is the cost of advertising. You can assume that the input will follow these restrictions: −106 ≤ r, e ≤ 106 and 0 ≤ c ≤ 106.

Output

Output one line for each test case: “advertise”, “do not advertise” or “does not matter”, presenting whether it is most profitable to advertise or not, or whether it does not make any difference.

Sample Input

3
0 100 70
100 130 30
-100 -70 40

Sample Output

advertise
does not matter
do not advertise

Source

Nordic 2006

在浏览别人的博客时,偶然发现了这道水题。难得啊,poj上竟然会有和A + B一样的纯净水!这就是众多试题中的一股清流!简单点,出题的方式简单点。

/*Problem: 3030       User: sarukaMemory: 368K        Time: 0MSLanguage: G++       Result: Accepted*/#include<cstdio>int getint(){    int r = 0, k = 1;    char c = getchar();    for(; c < '0' || c > '9'; c = getchar())        if(c == '-') k = -1;    for(; c >= '0' && c <= '9'; c = getchar())        r = r * 10 + c - '0';    return r * k;}int n, r, e, c;int main(){    n = getint();    while(n)    {        r = getint();        e = getint();        c = getint();        if(r + c > e)            printf("do not advertise\n");        else if(r + c == e)            printf("does not matter\n");        else             printf("advertise\n");        n--;    }    return 0;} 

Powered By Saruka
Copyright © 2016 All Rights Reserved.

0 0