2004 Canadian Computing Competition, Stage 1

Problem J3: Smile with Similes

A simile is a combination of an adjective and noun that produces a phrase such as "Easy as pie" or "Cold as ice".

Write a program to input n adjectives (1 ≤ n ≤ 5) and m nouns (1 ≤ m ≤ 5), and print out all possible similes. The first two lines of input will provide the values of n and m, in that order followed, one per line, by n adjectives and m nouns.

Your program may output the similes in any order.

Sample Input

3
2
Easy
Smart
Soft
pie
rock

Sample Output

Easy as pie
Easy as rock
Smart as pie
Smart as rock
Soft as pie
Soft as rock

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Sep 29, 2008

Problem Types: [Show]

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

It's quiet in here...