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 1.00
C++ 1.00
C++14 1.00
C# 1.00
Go 1.00
Java 1.00
JavaScript 1.00
Objective-C 1.00
Perl 1.00
PHP 1.00
Python 1.00
Python3 1.00
Ruby 1.00
VB.Net 1.00

Problem Stats




# User Language Timing
01 terminator_c Cpp14 0.00s
02 Nurul_CSE Cpp14 0.00s
03 Sabuj_CSE Cpp14 0.00s
04 rezaul_karim Cpp14 0.00s
05 Logic_Hunter Cpp14 0.00s
06 sadia2427 Cpp14 0.00s
07 jim1 Cpp14 0.00s
08 emrul Cpp14 0.00s
09 nazmul_bzs Cpp14 0.00s
10 SakibAlamin Cpp14 0.00s
11 joy25896 Cpp14 0.00s
12 Atick Cpp14 0.00s
13 rithu Cpp14 0.00s
14 subhashis_cse Cpp14 0.00s
15 mrinmoi Cpp 0.00s
16 maruf089 C 0.00s
17 lolcoder Cpp14 0.00s
18 pulak_ict_mbstu Cpp14 0.00s
19 1604099_ishtiaq C 0.00s
20 smriad Cpp14 0.00s
21 jalal Cpp14 0.00s
22 Bijoy26 C 0.00s
23 Ehsanul_Fahad Cpp 0.00s
24 monir769 Cpp 0.00s
25 mahmud2690 Cpp14 0.00s
26 abdulmukit Cpp 0.00s
27 Farhan_mahbub Cpp 0.00s
28 non_coder Cpp14 0.00s
29 Robbinb1993 Cpp 0.00s
30 Ruhul1975 Cpp 0.00s
31 10102020 Cpp 0.00s
32 Minhaj10 C 0.00s
33 muntasir10mu Cpp 0.00s
34 Mustakimcu C 0.00s
35 junaidpathan Cpp14 0.00s
36 Shajib C 0.00s
37 zahidbiscj CSharp 0.01s
38 eshaaan Cpp 0.01s
39 nazmulhyder CSharp 0.01s
40 humayun_ahmad Cpp 0.01s
41 IshratM Cpp 0.01s
42 Azizul_cse27 Cpp 0.01s
43 feodorv C 0.01s
44 testdragon Cpp 0.01s
45 Morass Cpp14 0.01s
46 rabbicse CSharp 0.02s
47 rockersabbir CSharp 0.02s
48 Ifrat CSharp 0.02s
49 minhaj_jami CSharp 0.02s
50 Sachie CSharp 0.02s

Your feedback is our precious!

Or call +88 02 9853138 for support