Beautiful View, Magnificient Desolation
All submissions for this problem are available.You are now at NASA! This time, in a strange format, NASA conducts one event every day over a span of $n$ days. As a participant you can buy tickets. Each ticket is allowed to be used for any $d$ consective days. You are given a detailed plan of the NASA events, and one ticket. You now want to find out, what is the maximum number of unique events you can attend by attending using 1 ticket for some consecutive set of $d$ days? ###Input Format - The first line has $T$, the number of test cases. - For each test case, the first line has two integers $n$ and $d$. - Each of the next $n$ lines has a string, the names of each event. There are no spaces in any event’s name. ###Constraints - $1 \leq T \leq 10$ - $1 \leq d \leq n \leq 10^4$ - For each string denoting an event, $1 \leq$ size of string $\leq 10$ ###Output Format For each test case, print one line having the maximum number of unique events you can attend using one ticket. ###Sample Input 2 3 3 lazarus lazarus lazarus 5 3 lazarus lazarus endurance apollo apollo ###Sample Output 1 3
|Tags||data-structure, medium, shpc2019, shriram_c253|
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, SQL, kotlin, PERL6, TEXT, SCM chicken, PYP3, CLOJ, R, COB, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.