UVa 11727 cost cutting (water ver.)

Source: Internet
Author: User
Tags time limit

11727-cost Cutting

Time limit:1.000 seconds

Http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=24&page=show_problem &problem=2827

Company XYZ have been badly hit by recession and are taking a lot of cost cutting measures. Some of measures include giving up office spaces, going open source, reducing incentives, cutting on luxuries and ISS Uing Pink slips.

They have got three (3) employees working in the accounts department and are going to lay-off two (2) of them. After a series of meetings, they have decided to dislodge the person who gets the most salary and the one who gets the Lea St. This is usually the general trend during crisis as this.

You are given the salaries of these 3 employees working in the accounts department. You are have the salary of the Who survives.

Input

The the "a" of input is a integer T (t<20) that indicates the number of test cases. Each case consists of the a line with 3 distinct positive integers. These 3 integers represent the salaries of the three employees. All of these integers is in the range [1000, 10000].

Output

For each case, output the case number followed by the salary of the Who survives.

Sample input Output for sample input

3

1000 2000 3000

3000 2500 1500

1500 1200 1800

Case 1:2000
Case 2:2,500
Case 3:1500

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/

Complete code:

/*0.013s*/
    
#include <cstdio>  
#include <algorithm>  
using namespace std;  
    
int a[3];  
    
int main ()  
{  
    int t;  
    scanf ("%d", &t);  
    for (int i = 1; I <= t; ++i)  
    {  
        scanf ("%d%d%d", &a[0], &a[1], &a[2));  
        Nth_element (A, A + 1, a + 3);  
        printf ("Case%d:%d\n", I, a[1]);  
    }  
    return 0;  
}

Author: csdn Synapse7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.