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




# User Language Timing
01 saurabh3240 Cpp14 0.00s
02 arif2603 Cpp14 0.00s
03 Hasinur_ Cpp14 0.00s
04 xpo6 Cpp14 0.00s
05 zahid119 Cpp14 0.00s
06 shamimjucse Cpp14 0.00s
07 imAnik Cpp14 0.00s
08 rummanrakib11 Cpp14 0.00s
09 snow_man Cpp14 0.00s
10 Rajan_sust Cpp14 0.00s
11 seyedssz Cpp14 0.00s
12 sazal_dev Cpp14 0.00s
13 ash12 Cpp14 0.00s
14 Najat Cpp14 0.00s
15 moshiur_cse15 Cpp14 0.00s
16 Sarwar05 Cpp14 0.00s
17 nuhu_iu Cpp14 0.00s
18 Ra007 Cpp14 0.00s
19 Koushik_12 Cpp14 0.00s
20 _Lucifer Cpp14 0.00s
21 MI47 Cpp14 0.00s
22 MAD_coder Cpp14 0.00s
23 jamil993 Cpp14 0.00s
24 inzamamdu Cpp14 0.00s
25 Ramprosad Cpp14 0.00s
26 MAHRahat Cpp14 0.00s
27 justfor1 Cpp14 0.00s
28 prodipdatta7 Cpp14 0.00s
29 jewel_ Cpp14 0.00s
30 nakib_ruet Cpp14 0.00s
31 subhashis_cse Cpp14 0.00s
32 SKL12 Cpp14 0.00s
33 Saimum_140128 Cpp14 0.00s
34 The_mover Cpp14 0.00s
35 Gang_Of_Three_01 Cpp14 0.00s
36 asib Cpp14 0.00s
37 aseem_cu Cpp14 0.00s
38 hiddenhopes Cpp14 0.00s
39 ibrahimnsu15 Cpp14 0.00s
40 mamunparvez Cpp14 0.00s
41 ____ Cpp14 0.00s
42 burhan103335 Cpp14 0.00s
43 pulak_ict_mbstu Cpp14 0.00s
44 robin_aust Cpp14 0.00s
45 showmic Cpp14 0.00s
46 haasib Cpp14 0.00s
47 ssavi Cpp14 0.00s
48 Indro_BU Cpp14 0.00s
49 rifat_cse Cpp14 0.00s
50 MRITuhin Cpp14 0.00s

Your feedback is our precious!

Or call +88 02 9853138 for support