لینکهای مفید برای شرکت در مسابقه:
در طول مسابقه، میتوانید سؤالات خود را از قسمت «سؤال بپرسید» مطرح کنید.
mrm_196 always rewrites the rooted trees in a simple array, but the array holds four conditions:
For example, he may store the following tree in one of these six ways:
Your task is pretty simple, find what he always wanted, THE DEGREE OF THE TREE!!!! Degree of a tree is the maximum degree of all its vertices.
The first line of the input contains an integer — the number tests to answer.
The first line of each test contains an integer — the number of vertices in the tree.
The second line of each test contains integers — the elements of his array.
It’s guaranteed that the given array always forms at least one valid tree.
For each test, print a single integer in one line — the degree of the tree.