﻿ Fuzhou University OnlineJudge ﻿  Problem 1909 An Equation

## Problem Description

Given four integers, your task is to find out whether there is a permutation A, B, C, D, such that the equation A+B=C+D holds.

For example, if there are four integers 2,5,6,3, we could find out an equation 2+6=3+5 that satisfies A+B=C+D. If there are four integers 1,2,4,9, we could not find out any equation that satisfies A+B=C+D.

If we could use these four integers to form an equation that satisfies A+B=C+D, please output “Yes”, otherwise output “No” instead.

## Input

The first line of the input contains an integer T (T <= 10), indicating the number of cases. Each case begins with a line containing four integers a,b,c,d (1 <= a,b,c,d <= 10).

## Output

For each test case, print a line containing the test case number (beginning with 1) and whether there is a permutation A, B, C, D, such that the equation A+B=C+D holds.

## Sample Input

4 2 3 5 6 4 3 2 1 2 1 1 2 1 2 4 9

## Sample Output

Case 1: Yes Case 2: Yes Case 3: Yes Case 4: No

## Source

2010年全国大学生程序设计邀请赛（福州）

Submit  Back  Status  Discuss 