You are a farmer and you want to create the biggest field possible to make your farm.
You are given certain side lengths, you need to find what is the largest square field and the largest rectangle field you can make using the side lengths.
Print $$$-1$$$ if making a particular field is not possible.
A Square field cannot be a Rectangular Field
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 500$$$) — the number of testcases
It is guaranteed that the sum of all $$$n$$$ across all test cases does not exceed $$$2*10^5$$$.
For each test, print two integers, the biggest square area and biggest rectangle area possible
3 8 1 1 1 1 2 2 2 2 8 1 1 2 2 2 2 3 3 8 1 2 3 4 5 5 5 5
4 2 4 6 25 -1
Sensible gambling is crucial to ensure that the activity remains enjoyable and does not spiral into harmful behavior. It involves setting limits on time and money spent, understanding the risks, and knowing when to walk away. By practicing self-control and being aware of the potential consequences, individuals can avoid the dangers of addiction and financial strain. Responsible gambling encourages balance, helping players enjoy the experience without it negatively impacting their lives or well-being.
You have $$$k$$$ amount of money which u are ready to risk for gambling and your goal is to have the most amount of money in the end
You are given an array of n integers which determine the money gained or lost playing the ith game.
Here's the description of the game, you can start playing from any index you want. Note that you can back out at any time
If you are currently playing game $$$i$$$, and this is your $$$j$$$'th game so far; Then the next game that you will be playing is game $$$i + j$$$
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 500$$$) — the number of testcases
For each test, print the maximum amount of money u can hold after playing the most desirable situation
3 5 5 -1 -1 -1 -1 -1 4 1 100 -500 -200 100 4 3 1 2 3 4
5 101 10
You are a farmer and you want to create the biggest field possible to make your farm.
You are given certain side lengths, you need to find what is the largest square field and the largest rectangle field you can make using the side lengths.
You have q queries to answer
Print $$$-1$$$ if making a particular field is not possible.
A Square field cannot be a Rectangular Field
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 500$$$) — the number of testcases
For each type 3 query, print two integers, the biggest square area and biggest rectangle area possible
1 5 9 1 1 2 2 3 3 1 3 3 2 3 2 2 3 2 1 2 1 3
-1 2 -1 6 -1 -1 -1 -1
You are looking to lose weight and feel the most healthiest form of yourself. You promise to yourself that you will workout regularly and very intensely.
But its not so easy, balancing work and rest is very difficult task, especially when you dont have proper knowledge about working out.
Balancing workouts and rest is essential for optimal muscle health and growth. While regular exercise strengthens muscles and improves endurance, rest allows them to recover, repair, and grow stronger. Overworking muscles without adequate recovery can lead to fatigue, injuries, and hindered progress. On the other hand, too much rest can stall fitness goals. Striking a balance by alternating intense workouts with rest days or lighter activities ensures steady improvement while reducing the risk of burnout or strain.
You are given n integers, ith of them determine the number of fats you can burn of on ith day
Here's the tradeoff between working out and rest if you are planning to work out on day i
Your job is choose certain days to work such that you can burn the maximum fat molecules that u can
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 500$$$) — the number of testcases
It is guaranteed that the sum of all $$$n$$$ across all test cases does not exceed $$$2*10^5$$$.
For each test, print the maximum fat you can burn
3 5 1 2 3 100 5 5 1 2 3 5 100 5 1 100 2 3 4
414 408 417