Question: C Programing Language Problem Title : Google Translate KW Super One day Jojo is typing something while drinking tea and eating snacks. It turns out

C Programing Language

Problem Title : Google Translate KW Super

One day Jojo is typing something while drinking tea and eating snacks. It turns out he is making the very problem youre reading right now. One of his biggest pet peeves about making these algorithm problems is that the description has to be written in two languages: English and Indonesian, this means that he has to write the exact same sentences twice in different languages. Because Jojo is a lazy guy, he asks for your help to create a simple translator program so that he only needs to write the problem description in English and let the program translate it to Indonesian.

The translator program works as follows: first the program will be given a dictionary which contains N English words and their translation in Indonesian. The program will then translate an English sentence simply by replacing each word in the sentence with its translation according to the dictionary. If a word doesnt exist in the dictionary, then the program will just display that word again. Now help Jojo to create this translator program!

Format Input

The first line contains a single number T, the number of testcases. Each testcase contains a single number N, the number of words in the dictionary. The next N lines contain the word AC Programing Language Problem Title : Google Translate KW Super One dayand BJojo is typing something while drinking tea and eating snacks. It turns , where Aout he is making the very problem youre reading right now. One is a English word and Bof his biggest pet peeves about making these algorithm problems is that is the Indonesian translation of that word. The next line contains Q which is the number of words in the sentence to be translated followed by another line containing all Q words that are in the sentence separated by space.

Format Output

For each testcase, output one line starting with Case #X: (without quotes) where X is the testcase number (starting from 1) followed by the translation of the English sentence.

Constraints

Lets say that Cthe description has to be written in two languages: English and Indonesian, means the i-th word on the English sentence to translate.

1 T 10

1 N, Q 100

1 |Athis means that he has to write the exact same sentences twice |, |Bin different languages. Because Jojo is a lazy guy, he asks for |, |Cyour help to create a simple translator program so that he only | 100 (|S| means the length of S)

|Aneeds to write the problem description in English and let the program|, |Btranslate it to Indonesian. The translator program works as follows: first the|, |Cprogram will be given a dictionary which contains N English words and | contain only lowercase English letters a-z

All values of Ai in a testcase are different

Sample Input 1 (standard input)

2

11

tea teh

something sesuatu

while sambil

one suatu

is sedang

snacks camilan

typing mengetik

drinking minum

eating makan

day hari

and dan

12

one day jojo is typing something while drinking tea and eating - snacks

9

an seorang

am adalah

she dia

among antara

and dan

i saya

theres ada

he dia

us kita

10

theres an impostor among us and i am an impostor

Sample Output 1 (standard output)

Case #1: suatu hari jojo sedang mengetik sesuatu sambil minum - teh dan makan camilan

Case #2: ada seorang impostor antara kita dan saya adalah - seorang impostor

NOTE :

Input And Output Must Be The Same

Don't Use library Stdlib.h

Use String.h If needed

Transcribed image text

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!