{"problem":{"name":"140. Continental Breakfast","description":{"content":"You're eating at a continental breakfast in a hotel, and there are two menu options. Each menu option consists of several food items. You want to find how many food items are contained in both menus. ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269140"},"statements":[{"statement_type":"Markdown","content":"You're eating at a continental breakfast in a hotel, and there are two menu options. Each menu option consists of several food items. You want to find how many food items are contained in both menus.\n\nThe first line of input consists of a single positive integer $n 1$: the number of food items on the first menu. The second line of input consists of $n 1$ space-separated strings: the food items on the first menu.\n\nThe third line of input consists of a single positive integer $n 2$: the number of food items on the second menu. The fourth line of input consists of $n 2$ space-separated strings: the food items on the second menu.\n\nOutput a single positive integer $n$: the number of food items that are contained on both menus. Then, output $n$ lines: each food item which is contained on both menus, *in alphabetical order*.\n\n## Input\n\nThe first line of input consists of a single positive integer $n 1$: the number of food items on the first menu. The second line of input consists of $n 1$ space-separated strings: the food items on the first menu.The third line of input consists of a single positive integer $n 2$: the number of food items on the second menu. The fourth line of input consists of $n 2$ space-separated strings: the food items on the second menu.\n\n## Output\n\nOutput a single positive integer $n$: the number of food items that are contained on both menus. Then, output $n$ lines: each food item which is contained on both menus, *in alphabetical order*.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ M_1 = \\{s_{1,1}, s_{1,2}, \\dots, s_{1,n_1}\\} $ be the set of food items on the first menu.  \nLet $ M_2 = \\{s_{2,1}, s_{2,2}, \\dots, s_{2,n_2}\\} $ be the set of food items on the second menu.  \n\n**Constraints**  \n1. $ n_1, n_2 \\in \\mathbb{Z}^+ $  \n2. All $ s_{1,i}, s_{2,j} $ are strings.  \n\n**Objective**  \nCompute the intersection $ M = M_1 \\cap M_2 $.  \nOutput:  \n- $ |M| $, the cardinality of $ M $,  \n- followed by the elements of $ M $ sorted in alphabetical order.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269140","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}