Smile with Similes | 프로그래밍의 벗 PivotOJ
PivotOJ

Smile with Similes

시간 제한: 1000ms메모리 제한: 128MB출처: CCC 2004 JuniorBOJ 6889

문제

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 nn adjectives (1n5)(1 \le n \le 5) and mm nouns (1m5)(1 \le m \le 5), and print out all possible similes. The first two lines of input will provide the values of nn and mm, in that order followed, one per line, by nn adjectives and mm nouns.

Your program may output the similes in any order.

예제

예제 1

입력
3
2
Easy
Smart
Soft
pie
rock
출력
Easy as pie
Easy as rock
Smart as pie
Smart as rock
Soft as pie
Soft as rock
코드를 제출하려면 로그인하세요.