DCP-370: Couple Land Back to All Problems

Easy Math > Basic Math


Mishuk a MO (Math Olympiad) contestant has just arrived on Park with his younger brother Monir for some refreshment. First time for Monir. To arrive here he has been so much surprised to see the environment of Park. <br/> <br/> Monir: Oh My God !! Couple, couple and couple. Is it a park or couple land, bro ? <br/> Mishuk: No, it is a Park, bro. <br/> Monir: Are you sure? <br/> Mishok: Definitely. <br/> Mishok: Well, I have remember a problem to see that environment. <br/> Monir: What type of problem ? <br/> Mishuk: Easy problem. <br/> Monir: Please tell me. <br/> Mishuk: Do you know about the couple ? <br/> Monir: Sure. <br/> Monir: It contains always two something. <br/> Mishok: Okay, my problem is....<br/><br/>Suppose you have N people, among them Odd numbers are representing Girls and Even numbers are representing the Boys and you know about the valid couple, it will be always (odd, even) or (even, odd) combination. Mind it, a cloned person or any homogeneous can not be a part of couple like (odd, odd) or (even, even). <br/> Now you have to tell that how many couple are possible from 1 to N people ? <br/> [Monir is thinking and thinking …..] <br/> <br/> Can you help Monir ? Note: All pairs must be pairwise different. See the explanation for more details. Input: ------ First there is an integer **T (1<=100)**, denoting the number of test cases. Each case contains an integer **N (1 ≤ N ≤ 10<sup>9</sup>)** denoting the number of People. Output: ------- For each case of input, Print "Case X: Y" where "X" is the case number and "Y" is the desired result which means possible couple can be built for N people according to above conditions. Here indexes are 1 based. Sample Input ------------ 3 5 6 7 Sample Output ------------- Case 1: 6 Case 2: 9 Case 3: 12 **Analysis:** <br/> *for the first test from 1 to 5, valid couples are (1, 2); (1, 4); (2, 3); (2, 5); (3, 4); (4, 5); <br/> for the second test valid couples are (1, 2); (1, 4); (1, 6); (2, 3); (2, 5); (3, 4); (3, 6); (4, 5); (5, 6); <br/> for the third valid couples are (1, 2); (1, 4); (1, 6); (2, 3); (2, 5); (2, 7); (3, 4); (3, 6); (4, 5); (4, 7); (5, 6); (6, 7);*


Problem Setter:

Pranta Sarker

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 0.50
C++ 0.50
C++14 0.01
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

59/109

Solve/Submission

Ranking

# User Language Timing
01 khatribiru Cpp 0.00s
02 BishalG Cpp 0.00s
03 nuhu_iu Cpp 0.00s
04 ssavi Cpp 0.00s
05 badhansen123 Cpp 0.00s
06 subhashis_cse Cpp 0.00s
07 KIRIN_36 Cpp 0.00s
08 mhiceiuk Cpp 0.00s
09 deder Cpp 0.00s
10 rayhan50001 Cpp 0.00s
11 rykamol Cpp 0.00s
12 pulak_ict_mbstu Cpp 0.00s
13 burhan103335 Cpp14 0.00s
14 tariqiitju Cpp 0.00s
15 shamimjucse Cpp 0.00s
16 Pure_Protea Cpp 0.00s
17 MRITuhin Cpp 0.00s
18 FariD Cpp14 0.00s
19 Sarwar05 Cpp 0.00s
20 jamil993 Cpp14 0.00s
21 sahin_ahmed Cpp 0.00s
22 leenaiitju Cpp 0.00s
23 Momin_just Cpp 0.00s
24 nurshuvo51 Cpp 0.00s
25 susmoys Cpp 0.00s
26 Key_logger Cpp 0.00s
27 Not_Found0001 Cpp 0.00s
28 rashedul_riad Cpp 0.00s
29 kissu_pari_na Cpp 0.00s
30 Bruteforcekid Cpp 0.00s
31 joymollick Cpp 0.00s
32 Sohan_Just Cpp 0.00s
33 asifthegreat Cpp 0.00s
34 arman_ferdous Cpp 0.00s
35 Freaky_Weirdo Cpp 0.00s
36 SakibAlamin Cpp 0.00s
37 Chydra Cpp 0.00s
38 souravahmed C 0.00s
39 zahidsheikh Cpp 0.00s
40 DynamicOvi Cpp 0.01s
41 AlaminJust Cpp 0.01s
42 10102020 Cpp 0.01s
43 Rajan_sust Cpp14 0.01s
44 kzvd4729 Cpp 0.01s
45 feodorv C 0.01s
46 abmahadi Cpp 0.01s
47 mhiceiu Cpp 0.01s
48 joy25896 Cpp 0.01s
49 giash_uddin Cpp 0.01s
50 hiddenhopes Cpp14 0.01s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support