HDU 5494 Card Game Sort

Source: Internet
Author: User

Card Game Time limit:2000/1000 MS (java/others) Memory limit:65536/65536 K (java/others)
Total submission (s): 94 Accepted Submission (s): 79


Problem Description Soda and Beta are good friends. They is going to play a card game today. Soda have n cards with number A1,A2,..., a while Beta have n cards with number B1,b2,..., bn.

First, they choose a number m no larger than N. Then they both randomly select M cards from their own n cards. The one with larger sum of the selected cards would win. Soda wants to know if he can all win no mater what cards would be is randomly selected from him and Beta.
Input There is multiple test cases. The first line of input contains an integer T (1≤t≤100), indicating the number of test cases. For each test case:

The first line contains both integer n and M (1≤m≤n≤500). The second line contains n integers a1,a2,..., an (1≤

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.