DCP-308: Happy New Year Back to All Problems

Beginner Beginners Problems > Ad-hoc

**Pahela Baishakh** is the traditional new year day of the Bangladesh. This year all of us celebrated this day on 14th April of English calendar, Interesting thing is that, On the same date, Nepali people also celebrated Nepali new year known as Naya Barsha 2074 ( Baishakh is also the first month of Nepali Bikram Sambat Calendar ). However, Nepali people celebrated new year -2074 by saying "**Shuva naya barsha 2074**" to each other while Bangladeshi people celebrated this new year -1424 by saying "**Shuvo nobo borsho 1424**". Basically there is 650 years differences between these two calendars. Now, your task is to convert the new year wish of one language to another one. That means if you have given input with the wish format of Bangladeshi new year, then you have to convert it into the new year wish format of Nepali language and vice versa. See the examples for more details. Input: ------ Input starts with an integer **N (1 ≤ N ≤ 10)** denoting the number wishes texts. The next N line will contain a valid message in one of the following format: Shuva naya barsha X Shuvo nobo borsho Y Where X and Y are positive integer greater than 1000 and upto 3000. If input is of format 1 , then this is Nepali New year wish, convert it into format 2 replacing given X with corresponding Bengali year. If input is of format 2 , then this is Bengali New year wish, convert it into format 1 replacing given Y with corresponding Nepali year. Output: ------- For each case of input, output a line with either Bengali New year wish or Nepali New Year wish by converting one language wish to another with year conversion. Sample Input ------------ 3 Shuvo nobo borsho 1424 Shuvo nobo borsho 1414 Shuva naya barsha 2074 Sample Output ------------- Shuva naya barsha 2074 Shuva naya barsha 2064 Shuvo nobo borsho 1424 **Explanation:** In the first case of sample, the given string contains a wish of Bengali format. So, at the output line we convert wish of Nepali format and also convert corresponding year 1424 in Bangla to corresponding Nepali year eqauls 1424+650 = 2074 in Nepali year. **Some Useful Links for New Year:** https://en.wikipedia.org/wiki/Bengali_calendar https://en.wikipedia.org/wiki/Vikram_Samvat

Problem Setter:

Bishal Gautam

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 0.20
C++ 0.20
C++14 0.20
C# 0.50
Go 0.50
Java 0.50
JavaScript 0.50
Objective-C 0.50
Perl 0.50
PHP 0.50
Python 0.50
Python3 0.50
Ruby 0.50
VB.Net 0.50

Problem Stats




# User Language Timing
01 imAnik Cpp14 0.00s
02 kzvd4729 Cpp14 0.00s
03 Pure_Protea Cpp14 0.00s
04 anik_JU Cpp14 0.00s
05 hrOarr Cpp14 0.00s
06 moshiur_cse15 Cpp14 0.00s
07 ArifKhanShubro Cpp14 0.00s
08 akib9ctg Cpp14 0.00s
09 nuhu_iu Cpp14 0.00s
10 HHMoon Cpp14 0.00s
11 Nazmul_WUB Cpp14 0.00s
12 jabertuhin Cpp14 0.00s
13 fearless_hasan Cpp14 0.00s
14 subhashis_cse Cpp14 0.00s
15 Mohaimin66 Cpp14 0.00s
16 aseem_cu Cpp14 0.00s
17 Dreamy_Idler Cpp14 0.00s
18 7Mahfuz Cpp14 0.00s
19 _GhOstMan_ Cpp14 0.00s
20 nahid08 Cpp14 0.00s
21 Khayrul_34 Cpp14 0.00s
22 Ishraq_Nibir Cpp14 0.00s
23 iamsadee Cpp14 0.00s
24 Jobayer__ Cpp14 0.00s
25 snow_man Cpp14 0.00s
26 sk_roy Cpp14 0.00s
27 zitul_mahmud Cpp14 0.00s
28 gazi93 Cpp14 0.00s
29 tyro_ Cpp14 0.00s
30 ____ Cpp14 0.00s
31 MI47 Cpp14 0.00s
32 badhansen123 Cpp14 0.00s
33 jayed_al_hasan Cpp14 0.00s
34 _c_k_r_ Cpp14 0.00s
35 sazeduliu Cpp14 0.00s
36 Trusted_Frustrated Cpp14 0.00s
37 Dragon_Curve Cpp14 0.00s
38 rayhan50001 Cpp14 0.00s
39 susmoys Cpp14 0.00s
40 johnbrightnew01 Cpp14 0.00s
41 MRITuhin Cpp14 0.00s
42 armondal Cpp14 0.00s
43 umli Cpp14 0.00s
44 akram Cpp14 0.00s
45 obujgalib Cpp14 0.00s
46 bafar Cpp14 0.00s
47 Momin_just Cpp14 0.00s
48 habib_rahman Cpp14 0.00s
49 mahbub07 Cpp14 0.00s
50 lazyfahim Cpp14 0.00s

Your feedback is our precious!

Or call +88 02 9853138 for support