Jagjeet is a famous personality in TSEC people are mad to meet him. But there's someone for whom Jagjeet is mad.......that's his best friend Sagar. Both of them like to play cricket. But Sagar is very busy unlike Jagjeet. At time $$$a$$$ (in seconds) Sagar is busy. Then every $$$b$$$ seconds after it, he is busy for $$$b$$$ and $$$b+1$$$ interval. Thus it sagar is busy at times a, a+b, a+b+1, a+2b, a+2b+1, etc.

Jagjeet is very desperate for playing cricket, but he wants to play with sagar when he is busy. Jagjeet plans to play at time $$$c$$$ (in seconds), so he asked you to tell him if sagar is busy at that time.
The first line of input contains an integer $$$n$$$ ($$$1 \leq n \leq 1000$$$) — the number of test cases.
The only line of each test contains 3 integers, $$$a$$$, $$$b$$$, $$$c$$$, ($$$1 \leq a, b, c \leq 10^9$$$)
Print a single "YES" (without quotes) if it's possible to play for both of them at time $$$c$$$ or a single "NO" (without quotes) otherwise in the only line of output.
10 3 2 6 1 1 1 8 7 10 2 9 8 3 4 6 1 5 6 8 9 4 7 5 3 10 8 3 1 4 1
Yes Yes No No No Yes No No No Yes
Lets see how well u know your divisors, you are given q queries of two types
The first line contains one integer $$$q$$$ ($$$1 \leq q \leq 10^6$$$) — the number of queries.
Then, the next $$$q$$$ lines contain the following types of queries:
For each query of type 1, return the number of numbers having odd number of divisors, and for each of type 2, return the number of numbers having even number of divisors
20 1 97 183 1 57 71 1 57 91 2 14 93 2 23 81 1 73 154 2 79 143 1 82 110 2 67 132 1 23 63 1 83 145 2 14 18 1 73 132 1 34 67 1 48 82 1 96 193 2 3 19 2 62 151 2 66 134 1 76 119
4 1 2 74 54 4 62 1 63 3 3 4 3 3 3 4 14 85 66 2
You are given a string of n characters
You need to find the length of the shortest substring that contains all letters 'h', 'a', 'r', 'd', 'w', 'o', 'r', 'k' in any order
Note that you the substring needs to contain two 'r'
If no substring exists which contains all these letters, print -1
First line consists of a single integer t, number of tests ($$$1 \leq t \leq 1000$$$)
First line of each test consists of single integer n, size of string ($$$1 \leq n \leq 10^5$$$)
Second line of each test consists of the word
For each test, print the length of the shortest substring that contains the letters 'h', 'a', 'r', 'd', 'w', 'o', 'r', 'k'
9 8 hardwork 7 hardwok 15 rwkrhhkkaokdrrw 15 kdrrwdoaahdoadw 15 dwororaohrkaaor 15 hhawdkowdhwarak 15 rarraakhaorkadh 15 rkrwawoarkrkdhk 15 woaodkdaoadrwdw
8 -1 10 10 11 -1 -1 9 -1
Vivek and Sagar are at an anime marathon, where there are $$$n$$$ anime episodes lined up for them to watch. Each anime episode has a unique enjoyment value, denoted as $$$a_i$$$ for the $$$i$$$-th episode.
The two friends take turns watching episodes, with Vivek going first:
The marathon continues until neither can select a suitable episode to watch. Let $$$x$$$ represent the total number of episodes Vivek manages to watch. While Vivek is eager to watch as many episodes as possible, Sagar's goal is to minimize the number of episodes Vivek gets to enjoy.
Determine how many episodes Vivek will end up watching if both play optimally.
Each test contains multiple test cases. The first line of input contains a single integer $$$t$$$ ($$$1 \le t \le 10$$$) — the number of test cases. The description of the test cases follows.
The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 15$$$) — the number of episodes.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$1 \le a_i \le n$$$) — the enjoyment value of the episode.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$15$$$.
For each test case, output a single integer — the number of episodes Vivek will watch if both players play optimally.
10 15 11 8 7 8 3 15 7 15 2 1 1 9 8 2 4 15 11 14 15 1 14 4 1 1 13 8 2 6 1 15 12 15 9 3 9 12 15 5 15 2 1 15 5 14 4 6 9 15 6 15 11 7 12 3 1 13 5 15 10 5 4 4 3 15 13 6 2 4 13 4 8 7 11 11 13 15 7 10 2 15 5 13 15 13 7 5 7 5 4 15 1 8 14 1 12 15 7 3 9 13 4 9 4 1 8 8 11 13 2 8 9 15 15 6 4 12 2 3 14 8 11 8 8 14 3 3 11 15 8 8 2 15 1 10 8 2 10 9 10 12 2 13 7 15 3 9 2 9 6 6 15 15 4 11 5 10 14 3 14
5 6 6 6 5 5 5 5 5 6
Dhrumil and Abhishek are playing a game on an array, Abhishek gives Dhrumil an array $$$a_1, a_2, \dots, a_n$$$ consisting of $$$n$$$ levels.
Abhishek provides Dhrumil with two types of operations:
In this version, l = 1 and r = n
Your task is to help Dhrumil to accurately find the points, else he will lose the game
The first line of input contains an integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.
For each test case:
Then, the next $$$q$$$ lines contain the following types of queries:
It is guaranteed that the sum of all $$$n + q$$$ across all test cases does not exceed $$$10^6$$$.
For each query of Type 2, output the weighted sum $$$S(l, r)$$$.
3 5 3 1 2 4 1 5 2 1 5 1 3 10 2 1 5 5 1 1 2 3 4 5 2 1 5 10 4 1 3 2 7 9 6 9 2 6 7 1 1 9 2 1 10 1 6 3 2 1 10
46 64 55 333 315
Dhrumil and Abhishek are playing a game on an array, Abhishek gives Dhrumil an array $$$a_1, a_2, \dots, a_n$$$ consisting of $$$n$$$ levels.
Abhishek provides Dhrumil with two types of operations:
Your task is to help Dhrumil to accurately find the points, else he will lose the game
The first line of input contains an integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of test cases.
For each test case:
Then, the next $$$q$$$ lines contain the following types of queries:
It is guaranteed that the sum of all $$$n + q$$$ across all test cases does not exceed $$$10^6$$$.
For each query of Type 2, output the weighted sum $$$S(l, r)$$$.
3 5 3 1 2 4 1 5 2 1 5 1 3 10 2 1 5 5 1 1 2 3 4 5 2 1 5 10 8 1 3 2 7 9 6 9 2 6 7 1 1 9 2 1 7 2 1 6 2 3 7 1 6 3 2 3 8 2 4 6 2 1 10
46 64 55 193 130 112 112 34 315