{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"Problem Statement","value":{"format":"MD","content":"Jimmy heard that you recently learned about the _Longest Increasing Subsequence_ problem. Jimmy wants to challenge you, so he gives you an array $A$ containing $n$ elements and asks you to find the length of the longest increasing subsequence in $A$.\n\n_\"But, this is the first problem in the contest...\"_\n\n\"Fine\", says Jimmy. He then gives you edit access to his contest problems for a brief moment, so you have just enough time to make a new array consisting of $n$ copies of $A$, written back to back. What is the longest increasing subsequence of the new array?"}},{"title":"Definitions","value":{"format":"MD","content":"A sequence $$$a$$$ is a subsequence of an array $$$b$$$ if $$$a$$$ can be obtained from $$$b$$$ by deletion of several (possibly, zero or all) elements. The longest increasing subsequence of an array is the longest subsequence such that its elements are ordered in **strictly** increasing order."}},{"title":"Input","value":{"format":"MD","content":"\u003cp\u003eThe first line contains an integer $$$t$$$\u0026nbsp;— the number of test cases you need to solve. The description of the test cases follows.\u003c/p\u003e\n\u003cp\u003eThe first line of each test case contains an integer $$$n$$$ ($$$1 \\le n \\le 10^5$$$)\u0026nbsp;— the number of elements in the array $$$A$$$.\u003c/p\u003e\n\u003cp\u003eThe second line contains $$$n$$$ space-separated integers $$$a_1$$$, $$$a_2$$$, $$$\\ldots$$$, $$$a_{n}$$$ ($$$1 \\le a_i \\le 10^9$$$)\u0026nbsp;— the elements of the array $$$A$$$.\u003c/p\u003e\n\u003cp\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003eThe sum of $$$n$$$ across the test cases doesn\u0027t exceed $$$10^5$$$.\u003c/span\u003e\u003c/p\u003e"}},{"title":"Output","value":{"format":"MD","content":"\u003cp\u003eFor each testcase, output the length of the longest increasing subsequence of $$$A$$$ if you concatenate it to itself $$$n - 1$$$ times (i.e., $n$ copies of $A$).\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"MD","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\u003e2\n3\n3 2 1\n5\n3 4 1 5 9\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\n5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"MD","content":"\u003cp\u003eIn the first sample, the new array is $$$[3,2,\\textbf{1},3,\\textbf{2},1,\\textbf{3},2,1]$$$. The longest increasing subsequence is marked in bold.\u003c/p\u003e\n\u003cp\u003eIn the second sample, the longest increasing subsequence will be $$$[1,3,4,5,9]$$$.\u003c/p\u003e"}}]}