B. CopyCopyCopyCopyCopy

B. CopyCopyCopyCopyCopy

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Ehab has an array aa of length nn. He has just enough free time to make a new array consisting of nn copies of the old array, written back-to-back. What will be the length of the new array's longest increasing subsequence?

A sequence aa is a subsequence of an array bb if aa can be obtained from bb 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.

Input

The first line contains an integer tt — the number of test cases you need to solve. The description of the test cases follows.

The first line of each t

猜你喜欢

转载自blog.csdn.net/chen_zan_yu_/article/details/104888237