{"problem":{"name":"F. I'm Bored!","description":{"content":"Being a judge is not always an interesting job! For example, it is very boring to wait for the first submission in the contest. So, judges used to entertain themselves using the \"_I'm Bored_\" tab in t","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10197F"},"statements":[{"statement_type":"Markdown","content":"Being a judge is not always an interesting job! For example, it is very boring to wait for the first submission in the contest. So, judges used to entertain themselves using the \"_I'm Bored_\" tab in the PC2 software. In this tab, a button is shown and you need to click it (if you can!). \n\nSince Alaa has been a judge in many contests, the \"_I'm Bored_\" tab is also boring to her, so, she decided to play a new game in today's contest. Alaa brings with her a huge bag full of lowercase English letters, and she starts playing with them. Alaa goal is to build a list of palindrome strings of the same length such that each string does not contain the same character more than two times.\n\nAfter 3 minutes of playing, Alaa wondered what is the longest string's length that she can build? And what is the maximum number of strings the list can contain? When Alaa brings her notebook to calculate the answers, she starts receiving dozens of submissions. So, she gives you her bag and asks you to find the answers for her. Can you?\n\nThe first line contains an integer T (1 ≤ T ≤ 104) specifying the number of test cases.\n\nEach test cases consists of a line containing 26 integers f1, ..., f26 (0 ≤ fi ≤ 109), in which fi is how many letters i Alaa has. The letters are numbered from 1 to 26 starting from '_a_'.\n\nFor each test case, print a single line containing two integers x and y, in which x is the length of the strings in the group and y is the size of the group.\n\nA _palindrome_ is a word, phrase, number, or other sequence of characters which reads the same backward as forward, such as \"_madam_\" or \"_racecar_\".\n\n## Input\n\nThe first line contains an integer T (1 ≤ T ≤ 104) specifying the number of test cases.Each test cases consists of a line containing 26 integers f1, ..., f26 (0 ≤ fi ≤ 109), in which fi is how many letters i Alaa has. The letters are numbered from 1 to 26 starting from '_a_'.\n\n## Output\n\nFor each test case, print a single line containing two integers x and y, in which x is the length of the strings in the group and y is the size of the group.\n\n[samples]\n\n## Note\n\nA _palindrome_ is a word, phrase, number, or other sequence of characters which reads the same backward as forward, such as \"_madam_\" or \"_racecar_\".","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, let $ f = (f_1, f_2, \\dots, f_{26}) \\in \\mathbb{Z}_{\\geq 0}^{26} $, where $ f_i $ is the frequency of the $ i $-th lowercase English letter (from 'a' to 'z').\n\n**Constraints**  \n1. $ 1 \\leq T \\leq 10^4 $  \n2. $ 0 \\leq f_i \\leq 10^9 $ for all $ i \\in \\{1, \\dots, 26\\} $\n\n**Objective**  \nFind the maximum possible values $ x, y \\in \\mathbb{Z}_{>0} $ such that:  \n- Each of the $ y $ strings has length $ x $,  \n- Each string is a palindrome,  \n- No character appears more than twice in any single string,  \n- The total number of times each letter $ i $ is used across all strings does not exceed $ f_i $.  \n\nMaximize $ x $, and for that $ x $, maximize $ y $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10197F","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}