DCP-244: Name for new Baby Back to All Problems

Easy Beginners Problems > Ad-hoc


Birth of a new baby in a family is a matter of joy. This makes everyone in family feel special. The only problem is naming her. Some member of family say that name should start with ‘P’ , and some member of family say that name should start with ‘S’ and so on. ![enter image description here][1] However, there are some concerns for naming new baby: 1. Start character must be written in capital letter ( ‘A’ to ‘Z’ ) 2. End character must be written in capital letter ( ‘A’ to ‘Z’ ) 3. Middle characters must be written in capital letter ( ‘A’ to ‘Z’ ) 4. Remaining characters must be written in either in capital letter ( ‘A’ to ‘Z’ ) or in small letter (‘a’ to ‘z’ ) ---------- Some Valid names are: - SiMaN - SwARnA - SAANVI Some Invalid names are: - biNdu - trishna - DevskiLL Now, you are given the length of baby’s name, your task is to calculate total numbers of variation of name pattern that may exists by following above mentioned concerns. ---------- **Note: Total middle characters will be 2 if the total length of name is even.** Input: ------ Input starts with an integer **T (1<=10)**, denoting the number of test cases. Each case contains an integer **N (1 ≤ N ≤ 10^9)** denoting the Length of name for baby. Output: ------- For each case of input, output the total numbers of variations of name patterns exists by following the valid pattern of naming. As the answer could be very large. so, print the answer modulo **1000000007** Sample Input ------------ 2 1 5 Sample Output ------------- 26 47525504 [1]: https://s3-ap-southeast-1.amazonaws.com/devskillimagestorage/questionimages/1741bca8-2d89-c316-b2cb-08d443580510_b2b0689e1b374ba0bfbefe361a2aee6f_W276xH165.jpg


Problem Setter:

Bishal Gautam

Please login to submit solution to this problem.

Problem Limits

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

93/215

Solve/Submission

Ranking

# User Language Timing
01 anowar1112 Cpp14 0.00s
02 rana_cse Cpp14 0.00s
03 ash12 Cpp14 0.00s
04 Koushik_12 Cpp14 0.00s
05 nuhu_iu Cpp14 0.00s
06 nakib_ruet Cpp14 0.00s
07 xpo6 Cpp14 0.00s
08 MAHRahat Cpp14 0.00s
09 MI47 Cpp14 0.00s
10 ssavi Cpp14 0.00s
11 badhansen123 Cpp14 0.00s
12 subhashis_cse Cpp14 0.00s
13 sayedgkm Cpp14 0.00s
14 aseem_cu Cpp14 0.00s
15 Saimum_140128 Cpp14 0.00s
16 mamunparvez Cpp14 0.00s
17 haasib Cpp14 0.00s
18 showmic Cpp14 0.00s
19 rajdipsaha Cpp14 0.00s
20 inzamamdu Cpp14 0.00s
21 Gang_Of_Three_01 Cpp14 0.00s
22 emrul Cpp14 0.00s
23 arif2603 Cpp14 0.00s
24 rifat_cse Cpp14 0.00s
25 sazal_dev Cpp14 0.00s
26 7Mahfuz Cpp14 0.00s
27 Najat Cpp14 0.00s
28 shamimjucse Cpp14 0.00s
29 asib Cpp14 0.00s
30 MAD_coder Cpp14 0.00s
31 _Lucifer Cpp14 0.00s
32 robin_aust Cpp14 0.00s
33 saiful130104 Cpp14 0.00s
34 MRITuhin Cpp14 0.00s
35 prodipdatta7 Cpp14 0.00s
36 Dragon_Curve Cpp14 0.00s
37 deder Cpp14 0.00s
38 rayhan50001 Cpp14 0.00s
39 The_mover Cpp14 0.00s
40 Hasinur_ Cpp14 0.00s
41 pulak_ict_mbstu Cpp14 0.00s
42 burhan103335 Cpp14 0.00s
43 ibrahimnsu15 Cpp14 0.00s
44 a_rahman Cpp14 0.00s
45 zahid119 Cpp14 0.00s
46 onucsecu Cpp14 0.00s
47 hiddenhopes Cpp14 0.00s
48 Sarwar05 Cpp14 0.00s
49 jamil993 Cpp14 0.00s
50 moshiur_cse15 Cpp14 0.00s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support