{"problem":{"name":"G. Paradise City","description":{"content":"Noura has been looking for a restaurant to host the SCPC2015 celebration in Lattakia, she decided that the best method to pick a restaurant is according to the number of contestants that are living ne","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10108G"},"statements":[{"statement_type":"Markdown","content":"Noura has been looking for a restaurant to host the SCPC2015 celebration in Lattakia, she decided that the best method to pick a restaurant is according to the number of contestants that are living near it. Given a grid representing the map of Lattakia, each 3x3 cells represent a district, each district will consist of 3x3 areas. The center of each district is a restaurant (X), other cells can be: \n\nThe first line of input contains an integer T (1 ≤ T ≤ 256), the number of test cases.\n\nThe first line of each test case contains an integer N (1 ≤ N ≤ 100), the number of districts. Then follows three lines, each consists of 3 × N characters, representing the map of the city of N districts.\n\nFor each test case, print the maximum number of students living in a district on a single line.\n\nWarning: large Input/Output data, be careful with certain languages.\n\n## Input\n\nThe first line of input contains an integer T (1 ≤ T ≤ 256), the number of test cases.The first line of each test case contains an integer N (1 ≤ N ≤ 100), the number of districts. Then follows three lines, each consists of 3 × N characters, representing the map of the city of N districts.\n\n## Output\n\nFor each test case, print the maximum number of students living in a district on a single line.\n\n[samples]\n\n## Note\n\nWarning: large Input/Output data, be careful with certain languages.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ N_k \\in \\mathbb{Z} $ denote the number of districts.  \n- Let $ M_k \\in \\{ \\text{char} \\}^{3 \\times (3N_k)} $ be a grid representing the city map, with 3 rows and $ 3N_k $ columns.  \n- Each district corresponds to a contiguous $ 3 \\times 3 $ block in $ M_k $, indexed by $ j \\in \\{1, \\dots, N_k\\} $, where the center cell of district $ j $ is at position $ (2, 3j - 1) $.  \n- Each cell in $ M_k $ contains either:  \n  - `'X'`: denotes the restaurant (center of district),  \n  - `'S'`: denotes a student living in that area,  \n  - `'.'`: empty space.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 256 $  \n2. For each $ k \\in \\{1, \\dots, T\\} $:  \n   - $ 1 \\le N_k \\le 100 $  \n   - $ M_k $ has exactly 3 rows and $ 3N_k $ columns  \n\n**Objective**  \nFor each test case $ k $, compute:  \n$$\n\\max_{j=1}^{N_k} \\left( \\sum_{\\substack{r=1,2,3 \\\\ c=3j-2,3j-1,3j}} \\mathbf{1}_{M_k[r][c] = 'S'} \\right)\n$$  \nOutput this maximum value.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10108G","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}