{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":" Andrew has just made a breakthrough in biology: he realized that most of genome\u0027s characteristics are determined by the absence or presence of certain prefixes and suffixes. So he needs to quickly test large arrays of genomes for that. More formally, we represent the genome as a string of lowercase English letters. We are given several genomes, and need to answer the following type of question: how many genomes from the given set have the given string \u003ci\u003ep\u003c/i\u003e as prefix \u003cimg src\u003d\"CDN_BASE_URL/71c590aa7c7c8fdc587f5b31f007560c?v\u003d1719493161\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003e the given string \u003ci\u003es\u003c/i\u003e as suffix. \u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eInput\u003c/b\u003e\u003c/div\u003eThe first line of the input file contains an integer \u003ci\u003en\u003c/i\u003e\u0026nbsp;— the number of genomes. The next \u003ci\u003en\u003c/i\u003e lines contain a non-empty string of lowercase English letters each, representing the given genomes. The total length of all given genomes doesn\u0027t exceed \u003cimg src\u003d\"CDN_BASE_URL/21dd0f41742fc98faa87a0689a328a7d?v\u003d1719493161\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003e. The next line contains an integer \u003ci\u003em\u003c/i\u003e\u0026nbsp;— the number of questions to answer. The next \u003ci\u003em\u003c/i\u003e lines contain two non-empty strings of lowercase English letters each, the first denoting the prefix and the second denoting the suffix. The prefix and suffix are separated with a single space. The total length of all given prefixes plus the total length of all given suffixes doesn\u0027t exceed \u003cimg src\u003d\"CDN_BASE_URL/0463aa355a6dc3935d445da5c25e0666?v\u003d1719493161\" style\u003d\"vertical-align: text-bottom;top: -2.0px;max-width: 100.0%;max-height: 100.0%;\"\u003e. \u003cbr\u003e\u003cdiv align\u003d\"left\" style\u003d\"margin-top: 1.0em;\"\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/div\u003eOutput \u003ci\u003em\u003c/i\u003e integers one per line. \u003ci\u003ei\u003c/i\u003e-th output line should contain the number of genomes that have \u003ci\u003ei\u003c/i\u003e-th given prefix and \u003ci\u003ei\u003c/i\u003e-th given suffix. \u003cbr\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\naaaaa\nabacabaa\navtobus\n6\na a\na aa\naa a\naaaaa aaaa\nabac caba\nabac a\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n2\n1\n1\n0\n1\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}