{"trustable":false,"sections":[{"title":"","value":{"format":"MD","content":"***Solve this in today\u0027s contest and I will give you a treat!*** -el.duivel (it\u0027s not the stopper I just like it but make sure you are able to explain every aspect of your solution)\nlone.wolf_ has a very busy weekend ahead of him. Because, the week after next is Valentine\u0027s Day, and he is planning to attend as many parties as he can because obviously he is lonely right now, he wants to find a date or two, in one of those parties. Since it\u0027s Valentines Day, he wants to wear nice a shirt on these parties, lone.wolf_ always selects his shirts in such a way that it blends with his friend\u0027s liking, that is, when he is attending the party, arranged by a friend, he will go to his party wearing a shirt of his friend\u0027s favorite color. For example, if his friend\u0027s favorite color is Red lone.wolf_ will go to his party wearing Red shirt, if another friend\u0027s favorite color is Black he will attend his party wearing Black shirt.\n\nSince he is going to attend a number of parties on the Valentine\u0027s day, and wear shirts accordingly, he will be changing his shirts a number of times. So, to make things a little easier, he may put on shirts, one over another (that is he may wear the Red shirt, over the Black shirt). Before each party he can take off some of the shirts, or wear a new one. That is, if he is wearing the Red shirt over the Black shirt, and wants to go to a party in the Black shirt, he can take off the Red shirt, or he can wear new Black shirt. But, keep in mind that, lone.wolf_ doesn\u0027t like to wear shirts without cleaning them first, so, after taking off the Red shirt, he cannot use that again in the Valentine\u0027s Day, if he needs the Red shirt again, he will have to use a new one. He can take off any number of shirts, and if he takes off **k** of the shirts, that will be the last **k** ones (e.g. if he wears shirt **A** before shirt **B**, to take off **A**, first he has to remove **B**).\n\nGiven the parties and the shirts, find the minimum number of shirts lone.wolf_ will need in the Valentine\u0027s Day."}},{"title":"Input","value":{"format":"MD","content":"Input starts with an integer **T (\u0026le; 200)**, denoting the number of test cases.\n\nEach case starts with a line containing an integer **N (1 \u0026le; N \u0026le; 100)** denoting the number of parties. Next line contains **N** integers, where the **i\u003csup\u003eth\u003c/sup\u003e** integer **c\u003csub\u003ei\u003c/sub\u003e** **(1 \u0026le; c\u003csub\u003ei\u003c/sub\u003e \u0026le; 100)** denotes the color of the shirt he will be wearing in party **i**. He will attend party 1 first, then party 2, and so on."}},{"title":"Output","value":{"format":"MD","content":"For each case, print the case number and the minimum number of required shirts."}},{"title":"Sample","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\u003cthead\u003e \u003ctr\u003e \u003cth\u003eInput\u003c/th\u003e \u003cth\u003eOutput\u003c/th\u003e \u003c/tr\u003e\u003c/thead\u003e\u003ctbody\u003e \u003ctr\u003e \u003ctd\u003e\u003cpre\u003e2\n4\n1 2 1 2\n7\n1 2 1 1 3 2 1\n\u003c/pre\u003e\u003c/td\u003e \u003ctd\u003e\u003cpre\u003eCase 1: 3\nCase 2: 4\n\u003c/pre\u003e\u003c/td\u003e \u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e"}}]}