{"problem":{"name":"G. WiFi Password","description":{"content":"Just days before the JCPC, your internet service went down. You decided to continue your training at the ACM club at your university. Sadly, you discovered that they have changed the WiFi password. On","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10160G"},"statements":[{"statement_type":"Markdown","content":"Just days before the JCPC, your internet service went down. You decided to continue your training at the ACM club at your university. Sadly, you discovered that they have changed the WiFi password. On the router, the following question was mentioned, the answer is the WiFi password padded with zeros as needed.\n\nA subarray [l, r] of an array A is defined as a sequence of consecutive elements Al, Al + 1, ..., Ar, the length of such subarray is r - l + 1. The bitwise OR of the subarray is defined as: Al OR Al + 1 OR ... OR Ar, where OR is the bitwise OR operation (check the notes for details).\n\nGiven an array A of n positive integers and an integer v, find the maximum length of a subarray such that the bitwise OR of its elements is less than or equal to v.\n\nThe first line contains an integer T (1 ≤ T ≤ 128), where T is the number of test cases.\n\nThe first line of each test case contains two space-separated integers n and v (1 ≤ n ≤ 105) (1 ≤ v ≤ 3 × 105).\n\nThe second line contains n space-separated integers A1, A2, ..., An (1 ≤ Ai ≤ 2 × 105), the elements of the array.\n\nThe sum of n overall test cases does not exceed 106.\n\nFor each test case, if no subarray meets the requirement, print 0. Otherwise, print the maximum length of a subarray that meets the requirement.\n\nTo get the value of x OR y, consider both numbers in binary (padded with zeros to make their lengths equal), apply the OR operation on the corresponding bits, and return the result into decimal form. For example, the result of 10 OR 17 = 01010 OR 10001 = 11011 = 27.\n\n## Input\n\nThe first line contains an integer T (1 ≤ T ≤ 128), where T is the number of test cases.The first line of each test case contains two space-separated integers n and v (1 ≤ n ≤ 105) (1 ≤ v ≤ 3 × 105).The second line contains n space-separated integers A1, A2, ..., An (1 ≤ Ai ≤ 2 × 105), the elements of the array.The sum of n overall test cases does not exceed 106.\n\n## Output\n\nFor each test case, if no subarray meets the requirement, print 0. Otherwise, print the maximum length of a subarray that meets the requirement.\n\n[samples]\n\n## Note\n\nTo get the value of x OR y, consider both numbers in binary (padded with zeros to make their lengths equal), apply the OR operation on the corresponding bits, and return the result into decimal form. For example, the result of 10 OR 17 = 01010 OR 10001 = 11011 = 27.","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $:  \n- Let $ n_k \\in \\mathbb{Z} $ be the length of the array.  \n- Let $ v_k \\in \\mathbb{Z} $ be the threshold.  \n- Let $ A_k = (a_{k,1}, a_{k,2}, \\dots, a_{k,n_k}) $ be a sequence of positive integers.  \n\n**Constraints**  \n1. $ 1 \\le T \\le 128 $  \n2. For each $ k \\in \\{1, \\dots, T\\} $:  \n   - $ 1 \\le n_k \\le 10^5 $  \n   - $ 1 \\le v_k \\le 3 \\times 10^5 $  \n   - $ 1 \\le a_{k,i} \\le 2 \\times 10^5 $ for all $ i \\in \\{1, \\dots, n_k\\} $  \n3. $ \\sum_{k=1}^{T} n_k \\le 10^6 $  \n\n**Objective**  \nFor each test case $ k $, find the maximum length $ L_k $ of a contiguous subarray $ A_k[l:r] = (a_{k,l}, a_{k,l+1}, \\dots, a_{k,r}) $ such that:  \n$$\n\\bigvee_{i=l}^{r} a_{k,i} \\le v_k\n$$  \nwhere $ \\bigvee $ denotes the bitwise OR operation.  \nIf no such subarray exists, $ L_k = 0 $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10160G","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}