DCP-36: Swapnil And Shibli Back to All Problems

Easy Beginners Problems > Ad-hoc

Swapnil and Shibli are best friends . Whenever they get some free time between classes they start playing with each other. They always try to play different interesting game. Today they get some free time between their theory and lab class. So they start playing. There are cards between 1-52 number on the table. They pick Randomly three cards from them. We can ensure you that there is no duplicate card on the table. Then they chose randomly one card and show to each other. If the number of Swapnil’s card is greater than Shibli’s card, then Swapnil wins otherwise Shibli wins. You know all three card numbers that Swapnil and Shibli pick from table. From that information, can you tell us who is going to win? If there is a scenario that anyone of them can win, then print “Both can win” otherwise print the winner’s name. If Swapnil wins then print “Swapnil wins” or if Shibli Wins then print “Shibli wins”. Input: ------ Input start with an integer **T ( T <= 10 )** denoting the number of test cases. Each test case consists of two lines and there are three integers **a1 , a2 , a3 ( 1 <= a1 < a2 < a3 <=52 )** in every line. the first line represents Swapnil’s cards and Second line represents Shibli’s cards. Output: ------- For each test case first print the case number “**Case %d:** ” then print “**Swapnil wins**” if Swapnil wins the game or “**Shibli wins**” If Shibli wins this game. If there is a scenario that both the player can win, then print “**Both can win**”. Sample Input ------------ 3 1 2 3 4 5 6 10 11 12 1 2 3 1 3 4 2 5 6 Sample Output ------------- Case 1: Shibli wins Case 2: Swapnil wins Case 3: Both can win

Problem Setter:

Shakil Ahmed

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C/C++ 1.00
Java 1.00
C# 1.00
PHP 1.00

Problem Stats




# User Language Timing
01 terminator_c Cpp 0.00s
02 simantaturja Cpp 0.06s
03 Dinar Cpp 0.07s
04 anis Cpp 0.07s
05 rayhan50001 Cpp 0.07s
06 haasib Cpp 0.07s
07 mahrahat Cpp 0.07s
08 chinmoysaha Cpp 0.08s
09 SkSaber Cpp 0.08s
10 Faridur Cpp 0.08s
11 Ashish_Deb Cpp 0.23s
12 RakibR3 Cpp 0.24s
13 ih_hira Cpp 0.25s
14 mahbub07 Cpp 0.31s
15 rash29 Cpp 0.34s
16 tariqiitju Cpp 0.39s
17 njrafi Cpp 0.40s
18 HR_Habib Cpp 0.40s
19 showmic Cpp 0.41s
20 moshiur_cse15 Cpp 0.42s
21 Ansarul_14 Cpp 0.46s
22 Ratnadeep24 Cpp 0.49s
23 jalal Cpp 0.49s
24 Sagor Cpp 0.49s
25 faisalxn Cpp 0.50s
26 rana_cse Cpp 0.53s

Your feedback is our precious!

Or call +88 02 9853138 for support