Alice and Bob are watching the World Cup Final. After the match ends in a draw, the result will be decided by a penalty shootout, featuring $$$n$$$ players from both Team A and Team B.
Each player's penalty kick success is determined by their shooting power $$$x_i$$$. A player scores a goal if their shooting power is greater than or equal to half the goalkeeper's height. Otherwise, they miss.
The team with the most goals wins. If both teams score the same number of goals, the winner is determined by the highest individual shooting power from the players on each team.
Alice believes that Team A will win, while Bob thinks Team B will come out on top. Your task is to determine who is correct.
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 500$$$) — the number of testcases
It is guaranteed that everyones shooting power is distinct
If team A wins print Alice else print Bob
2 5 4 6 1 6 4 8 7 2 3 9 5 10 5 4 6 1 2 3 4 5 6 7 8 9 10
Bob Bob
You are playing a card game with $$$n$$$ cards, with each card having a value positive or negative. You need to choose a non - empty subsequence of cards such that the total value of the cards is maximum.
Now your evaluator likes the number k so much. He will only like your sequence if you can divide the number of cards into groups of k. Hence you need to choose such a subsequence of cards which he likes.
A subsequence $$$a$$$ is a subsequence of a sequence $$$b$$$ if $$$a$$$ can be obtained from $$$b$$$ by the deletion of several(possibly zero) elements.
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 1000$$$) — the number of testcases
For each test, print the best value you can achieve
4 2 1 1 2 5 4 -1 -2 -3 -4 -5 6 2 4 -5 6 -3 4 -6 1 1 0
3 -10 11 0
After successfully tackling the rest and work balance last week, now you want to know exactly which exercises you must do on a particular training plan to burn the most fat.
You also have been browsing the internet, so you are learning about new exercises. So each day you are learning about some exercises. Here is how u can use them.
If you learn about a new exercise on day $$$i$$$, you can use it once to burn fat anytime between day $$$i$$$ and $$$n$$$
Also some exercises might make u gain fat instead of losing fat, they are identified by a negative fat burn.
You have n working days ahead of you, and your goal is to burn the most amount of fat after all n working days. Each day u need to choose atmost one exercise to perform. To balance the workload, you can perform an exercise only once throughout the n days.
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 50$$$) — the number of testcases
It is guaranteed that sum of $$$k$$$ over all days does not exceed $$$10^5$$$
For each test, print the maximum fat u can burn
1 5 2 5 10 2 9 4 2 11 3 2 20 1 1 35
85
You are playing Matchmaker, in this version of the game, two people are considered a match made in heaven only if both have everything in similar.
Once a match is made, those people cannot partipate in other matches (of course)
You are playing this game on a string. So two letters exactly equal can be considered as a match. But being a good matchmaker, you want the number of matches to be as much as possible. Hence you can perform one type of operation on the string
Since this task is very easy, you need to perform this on a particular substring of the string
You are given a string $$$s$$$ and $$$q$$$ queries to be answered on the string. For each query l, r you need to find that how many (minimum) characters between s[l], s[l + 1], s[l + 2].....s[r] must be changed such that you can create maximum number of matches between s[l], s[l + 1], s[l + 2].....s[r]
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 500$$$) — the number of testcases
It is guaranteed that sum of all $$$n + q$$$ among tests do not exceed $$$2 * 10^5$$$
For each test, print the answer of each query
2 6 4 abcdef 1 6 2 2 3 6 1 4 6 3 aaabbb 1 3 4 6 1 6
3 0 2 2 0 0 1