There are two teams, each consisting of N players, playing a round of Counter-Strike 2 (CS2).
You are given the total damage dealt by the players of one team to the opposing team. Specifically, you are given an array damage, where damage[i] is the total damage dealt by the i-th player to enemy players only.
Players cannot deal damage to their own teammates or themselves.
Each player on the round starts with exactly 100 Health Points (HP).
A player dies when their HP is reduced to 0, and the kill is awarded to the player who deals the final point of damage.
Multiple players may damage the same enemy, and a player may damage multiple enemies.
The given damage values may be distributed among the enemy team in any valid way that is consistent with these rules.
For every player, determine the minimum and maximum possible number of kills they could have achieved over all valid damage distributions.
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — 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 10^5$$$) — the number of players.
The second line of each test case contains $$$n$$$ space-separated integers $$$d_1, d_2, \dots, d_n$$$ ($$$0 \le d_i \le n \times 100$$$) — where $$$d_i$$$ represents the total damage dealt by the $$$i$$$-th player.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \times 10^5$$$, and the total sum of the array $$$d$$$ in any test case does not exceed $$$n \times 100$$$.
For each test case, output $$$n$$$ lines.The $$$i$$$-th line should contain two space-separated integers: the minimum possible number of kills and the maximum possible number of kills that the $$$i$$$-th player could have achieved in that round.
15100 100 1 100 2
0 30 30 10 30 2
In the first test case:We have $$$n = 5$$$ players with damages: $$$d = [100, 100, 1, 100, 2]$$$.The total damage dealt by the entire team is $$$100 + 100 + 1 + 100 + 2 = 303$$$.
Since each enemy has $$$100 \text{ HP}$$$, the maximum total number of enemies the team could have eliminated is at most $$$\lfloor 303 / 100 \rfloor = 3$$$ enemies.
Let us analyze the minimum and maximum kills for each player:
Players 1, 2, and 4
Each of these players dealt exactly $$$100$$$ damage.
Minimum kills = 0
A player can avoid getting any kill by never dealing the final hit. For example, they may deal most of the damage to an enemy, while another teammate delivers the last point of damage and receives the kill.
Maximum kills = 3
Since there are only $$$3$$$ possible kills in the entire round, the largest number of kills any player can obtain is $$$3$$$.
This is achievable because a kill only requires dealing the final point of damage. The player's $$$100$$$ damage can be split into many small portions, allowing them to deal the last point of damage to all three eliminated enemies while the remaining damage is provided by teammates.
Hence, for Players $$$1$$$, $$$2$$$, and $$$4$$$, the answer is [0,3].
Player 3
Player $$$3$$$ dealt only $$$d_3 = 1$$$ damage.
Minimum kills = 0
The single point of damage can be dealt to a surviving enemy, resulting in no kill.
Maximum kills = 1
A kill requires at least one point of final damage. Since Player $$$3$$$ has only one damage point in total, they can secure at most one kill by dealing the final hit to an enemy that already has only $$$1$$$ HP remaining.
Therefore, Player $$$3$$$ has range [0,1].
Player 5
Player $$$5$$$ dealt $$$d_5 = 2$$$ damage.
Minimum kills = 0
They may contribute damage without landing any final blow.
Maximum kills = 2
Their two damage points can be used as two separate finishing hits on two different enemies that were already reduced to $$$1$$$ HP by teammates.
Thus Player $$$5$$$ can obtain at most two kills, giving the range [0,2].
You are given an array $$$a$$$ of length $$$n$$$.
A permutation $$$p$$$ of length $$$n$$$ is called good if for each $$$i$$$ from $$$1$$$ to $$$n$$$ the following condition holds:
Find the number of good permutations modulo $$$10^9 + 7$$$.
Each test contains multiple test cases. The first line contains the number of test cases $$$t (1 \le t \le 5 \cdot 10 ^ 4)$$$. The description of the test cases follows.
The first line of each test case contains the integer $$$n (1 \le n \le 3 \cdot 10 ^ 5)$$$.
The second line of each test case contains $$$n$$$ integers $$$a_1,a_2,\dots,a_n (1 \le a_i \le n)$$$.
It is guaranteed that the sum of $$$n$$$ across all test cases does not exceed $$$3 \cdot 10^5$$$.
For each test case, output one integer: the answer modulo $$$10 ^ 9 + 7$$$.
331 1 131 2 352 1 2 1 2
6348
In the third test case the permutation $$$[3, 2, 1, 4, 5]$$$ is good because :
You are given two arrays $$$a$$$ and $$$b$$$ both of length $$$n$$$, the score of a range $$$[l, r]$$$ is defined as follows :
i.e the score of a range is the sum of $$$b_i$$$ over all $$$i$$$ such that $$$a_i$$$ is a prefix minimum or a suffix minimum in the range.
Find the maximum score of a range.
Each test contains multiple test cases. The first line contains the number of test cases $$$t (1 \le t \le 5 \cdot 10 ^ 4)$$$. The description of the test cases follows.
The first line of each test case contains the integer $$$n (1 \le n \le 2 \cdot 10 ^ 6)$$$.
The second line of each test case contains $$$n$$$ integers $$$a_1,a_2,\dots,a_n (1 \le a_i \le 10^9)$$$.
The third line of each test case contains $$$n$$$ integers $$$b_1,b_2,\dots,b_n (1 \le b_i \le 10^9)$$$.
It is guaranteed that the sum of $$$n$$$ across all test cases does not exceed $$$2 \cdot 10 ^ 6$$$.
For each test case, output one integer: the maximum score of a range.
231 2 13 5 351 2 3 1 27 8 2 4 9
821
On July 8, 2026, the Homs CPC contest was supposed to take place in Homs.
The judges were very excited about the contest. They had already packed their bags and booked a Pullman bus from Aleppo to Homs to attend the event.
However, the contest was canceled.
One of the judges, Chief Judge Apra, was furious. He had spent nearly two months preparing the problems, and he did not want all that work to go to waste.
So, Apra decided to publish his problems as a Codeforces contest instead.
The contestants from Homs University heard about Apra's plan. They wanted to prevent him from publishing the contest before anyone could read the problems.
They knew that Apra usually uses the password "password".
Your team has reached the login page and wants to guess Chef Apra's password.
Can you predict Chief Apra's password?
There is no input.
Print Chief Apra's password.
Print Chief Apra's password.
password
$$$Nowar$$$ and $$$Abodeh$$$ are organizing their graduation party. To make the place look more festive, they decided to prepare a large rectangular decoration board of size $$$n \times m$$$.
They have collected several decorative pieces that can be placed on the board:
Tiles may be rotated by any multiple of $$$90^\circ$$$. Each tile may be used at most once.
$$$Nowar$$$ has a specific design in mind. He wants the decorations to cover exactly a fraction $$$\frac{a}{b}$$$ of the total board area. $$$Abodeh$$$ is not sure whether this can be achieved using the available tiles, so he asks for your help.
No two tiles may overlap.
Determine whether it is possible to choose and place some of the available tiles so that the total covered area is exactly $$$\frac{a}{b}$$$ of the board's area.
The first line contains a single integer $$$T$$$ — the number of test cases.
Each test case consists of seven integers: $$$[n\ m\ s\ r\ t\ a\ b]$$$
where:
For each test case, print: YES if it is possible to obtain exactly the required area, or NO otherwise.
You may print each letter in any case.
42 2 2 1 0 1 13 3 1 1 1 1 21 1 0 0 1 1 22 3 1 1 0 5 6
YESNOYESNO
Apraham and Nowar are two world-renowned cryptographers who have dedicated their lives to solving the world's most complex puzzles.
One day, they received a mysterious locked briefcase containing a digital screen. On the screen, there was a long sequence of $$$n$$$ numbers where $$$n$$$ is a power of $$$2$$$, represented as an array $$$a$$$ of length $$$n$$$, with indices ranging from $$$0$$$ to $$$n-1$$$.
To unlock the briefcase and reveal the secret inside, they must find all the hidden connections within the sequence. The lock's security system evaluates pairs of indices, $$$i$$$ and $$$j$$$, using two fundamental bitwise operations. For any chosen pair, it calculates the Common Factor (using Bitwise AND, $$$i \ \& \ j$$$) and the Difference Factor (using Bitwise XOR, $$$i \oplus j$$$).
'Apraham notices a small hint engraved on the back of the briefcase: "True balance is achieved only when the paths of intersection and divergence hold the exact same value.'This means a pair of indices $$$(i, j)$$$ is considered a Valid Key Pair if and only if:$$$$$$a[i \ \& \ j] = a[i \oplus j]$$$$$$Nowar needs to find the total number of these Valid Key Pairs $$$(i, j)$$$ where $$$0 \le i, j \lt n$$$ to generate the final override code and open the briefcase.
Can you help Apraham and Nowar calculate the total number of valid pairs?
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — 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 2^{17}$$$) — the number of elements in the array $$$a$$$. It's guaranteed that $$$n = 2^k$$$ for some $$$1 \le k \le 17$$$.
The second line of each test case contains $$$n$$$ space-separated integers $$$a_0, a_1, \dots, a_{n-1}$$$ ($$$1 \le a_i \le 2^{17}$$$) — the values inside the array.It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2^{17}$$$.
For each test case, output a single integer — the total number of Valid Key Pairs $$$(i, j)$$$ such that $$$0 \le i, j \lt n$$$ and $$$a[i \ \& \ j] = a[i \oplus j]$$$.
441 2 3 485 5 5 5 5 5 5 521 1167 3 9 2 8 1 6 4 5 9 3 7 2 8 4 6
164430
The year is 2026, and the competitive programming scene is at its absolute peak. Homs-CPC and SVU-CPC are facing each other in a special challenge supervised by the legendary judge Kira and the strict coach Habbab.
To prepare for the challenge, the contestants are arranged in a fixed order. Each contestant has an integer $$$a_i$$$, representing their problem-solving skill level.
Coach Habbab wants to divide the contestants into exactly two distinct strategic groups during a crucial part of the contest: the Main Team and the Support Team.
You are given an array $$$a$$$ of $$$n$$$ integers, representing the skill levels of the contestants. Coach Habbab decides to choose a contiguous subarray from index $$$l$$$ to $$$r$$$ to form the Main Team. The remaining contestants (from index $$$1$$$ to $$$l-1$$$, and from $$$r+1$$$ to $$$n$$$) will form the Support Team. Due to his custom strategy, Coach Habbab must choose the indices such that $$$l \le r$$$ ($$$1 \le l \le r \le n$$$).
The "Judges' Score" of this strategy is calculated as the sum of two values:
1. The maximum skill level among the Main Team:
$$$$$$ \max(a[l], a[l+1], \dots, a[r]). $$$$$$
2. The MEX (Minimum Excluded value) of the skill levels among the Support Team:
$$$$$$ \operatorname{MEX}(a[1],a[2], \dots, a[l-1], a[r+1], a[r+2], \dots, a[n]). $$$$$$
(Note: The MEX of a set of integers is the smallest non-negative integer that does not belong to the set).
Kira and Coach Habbab want to find the best possible strategy that minimizes this total Judges' Score.
Help the contestants of Homs-CPC and SVU-CPC find the minimum possible score by choosing the optimal subarray $$$(l, r)$$$ under the condition $$$l \le r$$$.
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 10^4$$$) — the number of test cases.
Then, $$$T$$$ test cases follow.The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in the array $$$a$$$. The second line of each test case contains $$$n$$$ space-separated integers $$$a[1], a[2], \dots, a[n]$$$ ($$$0 \le a[i] \le 10^9$$$) — the skill levels of the players.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$ ($$$\sum n \le 2 \cdot 10^5$$$).
For each test case, print a single integer on a new line — the minimum possible Judges' Score that Kira and Coach Habbab can achieve by choosing a valid subarray $$$(l,r)$$$ under the condition $$$l \le r$$$.
1410 3 1 2
1
You are given a tree consisting of $$$N$$$ vertices numbered from $$$1$$$ to $$$N$$$. The tree has $$$N-1$$$ weighted edges, where the $$$i$$$-th edge connects vertices $$$u_i$$$ and $$$v_i$$$ and has a weight $$$w_i$$$ ($$$1 \le w_i \le M$$$).
Let $$$S$$$ be the set of all simple paths in the tree that contain at least one edge. A simple path can be uniquely identified by its unordered pair of distinct endpoints $$$(u, v)$$$ ($$$1 \le u \lt v \le N$$$). Thus, there are exactly $$$|S| = \frac{N(N-1)}{2}$$$ paths in the set $$$S$$$. Each path $$$x \in S$$$ can be viewed as a set of edges.
For any two paths $$$x, y \in S$$$, we denote $$$x \cap y$$$ as the set of edges that are common to both paths. We define a cost function $$$f(x, y)$$$ as follows:
$$$$$$f(x, y) = ( \sum_{e \in x \cap y} w_e ) \cdot \gcd_{e \in x \cap y}(w_e)$$$$$$
I.e.: the value of a function is the sum of the weights on the intersection path of $$$x$$$ and $$$y$$$ times the GCD of the weights on the intersection path of $$$x$$$ and $$$y$$$, where $$$\gcd(i, j)$$$ is the greatest common divisor of $$$i$$$ and $$$j$$$.
Your task is to calculate the total sum of $$$f(x, y)$$$ over all ordered pairs of paths $$$(x, y)$$$ from the set $$$S$$$.
Since the total sum can be very large, output it modulo $$$998244353$$$.
The first line of the input contains a single integer $$$T$$$ ($$$1 \le T \le 10^4$$$) — the number of test cases.
The description of the test cases follows.
The first line of each test case contains two space-separated integers $$$N$$$ ($$$1 \le N \le 10^5$$$) and $$$M$$$ ($$$1 \le M \le 10^5$$$) — the number of vertices in the tree and the maximum possible edge weight.
Each of the next $$$N-1$$$ lines contains three space-separated integers $$$u_i$$$, $$$v_i$$$, and $$$w_i$$$ ($$$1 \le u_i, v_i \le N$$$, $$$u_i \neq v_i$$$, $$$1 \le w_i \le M$$$) — meaning there is an edge between vertices $$$u_i$$$ and $$$v_i$$$ with weight $$$w_i$$$.
It is guaranteed that the given edges form a valid tree, and the sum of $$$N$$$ and the sum of $$$M$$$ over all test cases does not exceed $$$10^5$$$.
For each test case, print a single integer — the total sum of $$$f(x, y)$$$ for all ordered pairs of distinct paths $$$(x, y)$$$, modulo $$$998244353$$$.
34 101 2 42 3 63 4 85 151 2 51 3 72 4 32 5 93 201 2 22 3 3
904208044
In the third test case, the tree consists of $$$N = 3$$$ vertices and has two weighted edges: $$$(1, 2)$$$ with weight $$$2$$$, and $$$(2, 3)$$$ with weight $$$3$$$.
There are exactly $$$|S| = \frac{3 \cdot (3 - 1)}{2} = 3$$$ simple paths containing at least one edge:
We calculate the function $$$f(x, y) = \left(\sum_{e \in x \cap y} w_e\right) \cdot \gcd_{e \in x \cap y}(w_e)$$$ for all $$$3 \times 3 = 9$$$ ordered pairs of paths:
Summing these values together gives: $$$$$$4 + 9 + 5 + 4 + 4 + 9 + 9 + 0 + 0 = 44$$$$$$ Thus, the total sum for the third testcase is $$$44$$$.
$$$Abodeh$$$, $$$Nowar$$$, and $$$Hussein$$$ decided to organize a football tournament. In each match, exactly $$$2$$$ players are required to play. For any village with $$$x$$$ people, they want to know how many full matches they can organize, leaving at most one person as a substitute. Let this number be $$$f(x)$$$.
Now, they are given a range of villages from $$$L$$$ to $$$R$$$. They need your help to calculate the total number of matches they can organize across all these villages.
More formally:
$$$f(x)$$$ is the number of terms equal to $$$2$$$ in the representation of $$$x$$$ as a sum of several $$$2$$$'s and, if needed, one $$$1$$$.
For example:
You need the sum of $$$f(x)$$$ for all $$$x$$$ from $$$L$$$ to $$$R$$$:
$$$$$$ Answer = \sum_{x=L}^{R} f(x). $$$$$$
The only line of input contains two integers $$$L$$$ and $$$R$$$ ($$$1 \le L \le R \le 10^5$$$).
Print a single integer — the required sum.
2 9
20
51 501
62125
2 56
784
4 5
4
4 15
54
Edward and Sawaha are two brilliant scientists working at a secret data research facility.
Recently, they uncovered two ancient digital archives containing encrypted energy frequencies.
For security reasons, both archives contain an identical number of data elements. Edward manages the first archive, which can be represented as an array $$$A$$$, while Sawaha is in charge of the second archive, represented as an array $$$B$$$.
To unlock the core secret of these frequencies, Edward and Sawaha need to synchronize the data by forming pairs.
A pair is created by matching exactly one element from Edward's archive with exactly one element from Sawaha's archive. Each element from either archive can be used at most once, meaning that no element can belong to more than one pair.
The power value of a synchronized pair containing the elements $$$a$$$ and $$$b$$$ is calculated as their product ($$$a \times b$$$). The entire system will stabilize only if they can select a certain number of pairs such that every single selected pair has a power value greater than or equal to the total number of selected pairs.Edward and Sawaha want to achieve the maximum possible level of system stability.
Your task is to help them determine the maximum integer $$$x$$$ such that it is possible to choose at least $$$x$$$ completely disjoint pairs, where the product of the elements in each chosen pair is at least $$$x$$$.
The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — 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 2 \cdot 10^5$$$) — the number of elements in each of the two archives.
The second line of each test case contains space-separated integers $$$A_1, A_2, \dots$$$ — representing the values in Edward's archive.The third line of each test case contains space-separated integers $$$B_1, B_2, \dots$$$ — representing the values in Sawaha's archive.
It is guaranteed that the total number of elements across all test cases does not exceed $$$2 \times 10^5$$$, and each individual element in both archives has a value between $$$1$$$ and $$$10^9$$$ inclusive.
For each test case, output a single integer — the maximum possible value of $$$x$$$ that Edward and Sawaha can achieve.
242 5 1 43 1 3 231 2 11 1 2
32
In the first test case:Edward's archive contains the elements: $$$A = [2, 5, 1, 4]$$$.
Sawaha's archive contains the elements: $$$B = [3, 1, 3, 2]$$$.We want to find the maximum integer $$$x$$$ such that we can form at least $$$x$$$ disjoint pairs, and the product of each pair is $$$\ge x$$$.
Let us test if it is possible to achieve $$$x = 3$$$:To achieve $$$x = 3$$$, we need to form at least $$$3$$$ pairs, and the product of each pair must be greater than or equal to $$$3$$$. We can strategically pair the elements as follows:First Pair: Match element $$$5$$$ from Edward's archive with element $$$3$$$ from Sawaha's archive.$$$$$$\text{Product} = 5 \times 3 = 15 \quad (\text{Since } 15 \ge 3, \text{ this pair is valid})$$$$$$Second Pair: Match element $$$4$$$ from Edward's archive with element $$$2$$$ from Sawaha's archive.$$$$$$\text{Product} = 4 \times 2 = 8 \quad (\text{Since } 8 \ge 3, \text{ this pair is valid})$$$$$$Third Pair: Match element $$$2$$$ from Edward's archive with element $$$3$$$ from Sawaha's archive.$$$$$$\text{Product} = 2 \times 3 = 6 \quad (\text{Since } 6 \ge 3, \text{ this pair is valid})$$$$$$We successfully formed $$$3$$$ valid disjoint pairs where every pair's product is $$$\ge 3$$$.It is impossible to choose $$$4$$$ disjoint pairs that all satisfy a product $$$\ge 4$$$ because the remaining unused elements are $$$1$$$ (from Edward) and $$$1$$$ (from Sawaha), which would result in a product of $$$1 \times 1 = 1 \lt 4$$$.Therefore, the maximum possible value of $$$x$$$ for the first case is $$$3$$$.
Edward is shopping in Homs. There are $$$n$$$ shops arranged in a row, and shop $$$i$$$ sells one item with price $$$a_i$$$.
The street has two entrances:
Initially, Edward stands outside the left entrance and has $$$k$$$ money.
Edward starts from the left entrance. He may buy a prefix of items:
$$$$$$ \left[a_1, a_2, \ldots, a_x\right] $$$$$$
where $$$0 \le x \le n$$$. The prefix is allowed to be empty.
After that, Edward may switch entrances at most once. If he switches, he enters from the right entrance and buys a suffix of items in the following order:
$$$$$$ \left[a_n, a_{n-1}, \ldots, a_{n-y+1}\right] $$$$$$
where $$$0 \le y \le n-x$$$. The suffix is allowed to be empty.
Therefore, for some $$$x$$$ and $$$y$$$, Edward buys items in the exact order:
$$$$$$ \left[a_1, a_2, \ldots, a_x, a_n, a_{n-1}, \ldots, a_{n-y+1}\right] $$$$$$
The shop owner gives Edward $$$d$$$ coupons.
Before buying an item, Edward may use one unused coupon on it. If he does, the item's price becomes $$$0$$$, and Edward can buy it without spending any money.
Each coupon can be used on at most one item, and each item can be bought at most once.
Before buying an item without using a coupon, Edward must have at least its price. After buying it, his amount of money decreases by its price. Note that if an item's price is negative, buying it increases Edward's money.
Find the maximum number of items Edward can buy without ever being unable to afford an item.
The first line contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases.
The first line of each test case contains three integers $$$n$$$, $$$k$$$, and $$$d$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$1 \le k \le 10^{16}$$$, $$$1 \le d \le 20$$$).
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$-10^9 \le a_i \le 10^9$$$), where $$$a_i$$$ is the price of the item in shop $$$i$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, print one integer — the maximum number of items Edward can buy.
36 5 14 -10 50 50 -2 35 75 190 100 -1000 100 904 4 17 8 -4 7
513
You are given an integer $$$M$$$ and you have an empty array $$$a$$$. You have to process $$$q$$$ queries on array $$$a$$$, there are two types of queries :
Each test contains multiple test cases. The first line contains the number of test cases $$$t (1 \le t \le 5 \cdot 10 ^ 4)$$$. The description of the test cases follows.
The first line of each test case contains two integers $$$q$$$ and $$$M$$$ $$$(2 \le q, \ 2 \le M, \ \mathbf{q * M \le 3 \cdot 10 ^ 5})$$$.
Each of the next $$$q$$$ lines contains the description of a query in one of the following formats:
It is guaranteed that the sum of $$$\mathbf{q * M}$$$ across all test cases does not exceed $$$\mathbf{3 \cdot 10 ^ 5}$$$.
Output the answer for each query of the second type.
18 31 1 21 2 21 3 2221 2 322
3223
here is how the array $$$a$$$ changes during the queries :
Majed is working on an old digital calculator. Unfortunately, some of its displays are damaged, and each displayed number contains exactly one corrupted character instead of a digit.
The calculator shows two strings $$$x$$$ and $$$y$$$, each of length exactly $$$3$$$. Every string contains exactly two decimal digits ('0' to '9') and one non-digit character. The corrupted character may appear in any position.
To recover the original numbers, Majed removes the corrupted character from each string. The remaining digits keep their relative order and form a two-digit integer. It is guaranteed that the resulting integers do not contain leading zeros.
Help Majed determine the product of the two recovered integers.
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 10^5$$$), the number of test cases.
Then $$$T$$$ test cases follow.
Each test case consists of a single line containing two strings $$$x$$$ and $$$y$$$ separated by a space.
Each of $$$x$$$ and $$$y$$$ has length exactly $$$3$$$, contains exactly two decimal digits and one non-digit character.
After removing the non-digit character from a string, the remaining digits form a two-digit integer. It is guaranteed that these integers do not contain leading zeros.
For each test case, print a single integer on a separate line: the product of the integers obtained after removing the non-digit character from $$$x$$$ and $$$y$$$.
344$ !194#4 19!%44 1!9
836836836
In the first test case, the string 44$ becomes 44 after removing the non-digit character $, and the string !19 becomes 19 after removing !.
Therefore, the answer is $$$44 \times 19 = 836$$$.
Coach $$$Apraham$$$ informed $$$Kira$$$ that the Homs-CPC would be held soon and requested that they
draft some competition problems.
$$$Kira$$$ proposed this particular problem, considering it to be an easy task, and now requests your solution.
You are given a non-negative integer $$$n$$$.
Count the number of non-negative integers $$$x$$$ such that :
The first line contains a single integer $$$T$$$ ($$$1 \le T \le 10^5$$$), the number of test cases.
Then $$$T$$$ test cases as follow.
Each test case consists of a single linecontains one integer $$$n$$$ ($$$0 \le n \le 2^{30}$$$ -$$$1$$$).
For each test case, print a single integer on a separate line: Print the number of valid integers $$$x$$$ .
1125634
2097152