₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,346,364 members, 8,522,622 topics. Date: Saturday, 21 November 2026 at 04:18 PM

Toggle theme

Turmacs's Posts

Nairaland Forum › Turmacs's Profile › Turmacs's Posts

1 2 3 4 5 6 7 8 9 10 (of 24 pages)

Celebrities › Re: Prankster, Zfancy, Arrested By Police In Abuja by turmacs(f): 7:40pm On Jul 04, 2024
Nigerians can be very jealous people.
Business › Re: Real Reason GSK Left Nigeria After 51 Years by turmacs(f): 10:40am On Jul 04, 2024
Wait OP, you really expect somebody to read all these things you wrote up there? Haaa..

Anyway, i don't know who needs to hear this but if you have a friend that loves to eat head of chicken, head of goat, fish, or head of any meat in general, run from those types of people, i repeat, run from those types of people. A lot of the signs most of us take for granted and think that it actually doesn't mean anything are actually all you need to know the type of person somebody is. Any friend of yours wey go open eye dey eat head of animal, keep that kind friend at a safe distance.
Romance › What Lifestyle Of Yours Did You Have To Change Because Of Your Partner? by turmacs(op): 9:47am On Jul 04, 2024
Mine was posting pictures of myself or anything related to my daily life on social media. He said he doesn't like those type of things. Even my birthday i don't post anymore ever since i met this boy, happy new month or new year i don't post, i can't even remember the last time i posted on my Whatsapp status grin I even had to change my profile pictures on all social media from my personal photos to something else.

Chai, things we do for love grin

Programming › Re: Mathematics Gurus, Please Come In by turmacs(f): 5:00pm On Jul 02, 2024
This is not mathematics section or education section you this idiot... Take this to the right section and stop disturbing us with this primary 6 work, mumu. This section is filled with ordinary web developers, non of them here know simple arithemetic.
TV/Movies › Re: Rita Dominic Slams A Critic Of Her ‘Lekki Wives' Appearance by turmacs(f): 9:17am On Jul 01, 2024
kiss
Family › Re: Marriage Covenant: Relevance & Impact On Marital Success - SureHome June 2024 by turmacs(f): 3:13pm On Jun 30, 2024
Lolzz. Seun papa should better go and do DNA test for Seun ohh, because that guy no resemble am at all.
Programming › Re: Check out this my conversations with Meta AI by turmacs(f): 2:52pm On Jun 30, 2024
Xpol:
It's like this guy is si.k. or maybe you hit your head on mango tree in those days.

People like you shouldn't be spared of counterattack.
no be only counterattack, na tiki taka. Even by the kind of jokes you make, i don know your iq Finnish.
Programming › Re: Check out this my conversations with Meta AI by turmacs(f): 2:44pm On Jun 30, 2024
Xpol:
Still on still human brain is still superior and will forever be.
look at the idiot that's calling me strong head. You can't just take corrections and shut up. human brain is superior yes, but you own brain isn't.
Programming › Re: Has Any One Done 2 Terabyte On Starlink Without Issues by turmacs(f): 12:30pm On Jun 30, 2024
Mumu, money miss road. You carry money go buy wetin you no understand. Starlink is unlimited data as long as you subscribe, mumu. Even if you like you 1e9 terabytes, as long as you subscription hasn't expired, nothing to worry about. Idiot. You think it's like fibre one abi spectranet, fool.
Programming › Re: Check out this my conversations with Meta AI by turmacs(f): 12:20pm On Jun 30, 2024
obiekunie01:
OLODO AI.

you even have to give am expo.
another idiot spotted. Read my last comment because you and the OP sickness get the same colour.
Programming › Re: Check out this my conversations with Meta AI by turmacs(f):
between you and the AI i no know who mumu pass tongue you ask questions like an idiot. Because if you actually worded that question like a sensible human being, the AI might have gotten it. Still on still, the AI is not wrong, you just don't having sense to see that. Even if you shoot one of the birds and the others run away, it doesn't matter if they remain there or fly away, no matter where they fly to, there will always still be 3 birds left. Are they dummy birds or live birds? How many branches does the tree have? Because they can still move to a different branch on that same tree. what is the size of the tree? e.t.c... lots of data and variables need to be considered before an answer is give out. Just like how the number of significant digits determine the precision of a number, the amount of data you give to the AI will determine the precision of the AI's answer. You just gave the AI a pixel of the whole picture and it gave you an answer according to your sense.

Idiot.
Christianity Etc › Re: What Does The Bible Say About Kissing And Hugging One's Fiance? by turmacs(f): 9:08am On Jun 30, 2024
If you ever feel useless or stupid in life, just remember that Christian and Muslim people exist
Romance › Guys, Hope You Have A Plan On How You'll Become Wealthy? by turmacs(op): 7:51am On Jun 30, 2024
Guy's jokes aside, If you aren't rich or wealthy, hope you have a plan on how to become it? Because if you're just working a 9-5 like a zombie, without any plan on how you'll get out of the rat race and become a dollar millionaire, you're making a very big mistake, time dey go ohh. people wey dem born for 2006 now na 18 years ohh, hmm.
Programming › Re: This Was a Jane Street interview question by turmacs(op): 8:44am On Jun 28, 2024
You can also use chatgpt to convert the solution to any programming language you want so that you can understand it smiley
Programming › Re: This Was a Jane Street interview question by turmacs(op):
tongue
Programming › Re: This Was a Jane Street interview question by turmacs(op): 7:05am On Jun 28, 2024
xokol8:
The answer?
Solution coming soon smiley
Health › Re: Pregnant Nigerian Woman And Unborn Triplets Die In UK Three Days After Birthday by turmacs(f):
cry
Politics › Re: FG Spent ₦1 Billion On Tinubu’s Trip To Ethiopia, ₦650 Million On Honorarium by turmacs(f): 4:09pm On Jun 27, 2024
President bola Ahmed Tinubu, the destinies of 200 Million Nigerians are in your hands, please do not let us down.
Education › Re: Blaise Felix Aliyu Tortured To Death By Students At Air Force School, Kaduna by turmacs(f):
Imagine. I weep for this zoo.

Anyways, this is to remind those of you that any small fight or quarrel you have with somebody, you don rush go Carry weapon or rush dey threaten to kill the person. Let me just tell you that as you're killing the person, just make provisions to kill yourself too ohh, because if not, wetin your eye's go see for Nigerian prison ehh, i swear you will be begging for death sentence. It's better to be a dead man than to spend the rest of your life in a Nigerian Prison ohh, hmmm.
Romance › Re: Please Help!!!! Somebody Is Threatening To Stab My Sister To Death (pics) by turmacs(f): 8:51pm On Jun 22, 2024
People dey ohh, na wahh. Which kind of human being is this one now? Please find a way to lock up that idiot for life, because his freedom is a threat to that girl.
Crime › Re: 20-Year-Old Man Kidnaps Himself, Collects ₦5M Ransom In Bitcoin From His Father by turmacs(f): 10:01am On Jun 20, 2024
imbless:
Why would a 20yrs old man be entitled to his parents money, what happens to working to make his own money, na we just dey spoil our kids these days, oyibo people can will 100% of their wealth to charity without giving their children shi shi.
I'm not surprised. Comments like these mostly come from children with poor parents who are jealous of children with rich parents. I'll hussle to make sure my children never have to work a day in their life, they will live to only do what makes them happy. Even if my child turn out to be the worst children a parent can have, I'm never giving my money to an outsider in the name of "charity", if my children can work to make their own money, the charity too can work to make their own money. I'd rather have my children squander my money than an outsider. Better stop being jealous of children with rich parents.
Pets › Re: Rottweiler Catches A Thief And Refuses To Let Him Go (Video) by turmacs(f): 9:50am On Jun 20, 2024
Xpol:
So you mean if your dogs kill a thief you'll be jailed?
Yes. Especially if you're around and aware when your dog was in the process of killing the thief. But say you were not at home when it was happening, then nothing will happen to you. But if you decide to be as foolish as the dude in that video, recording instead of restricting the dog and subduing the thief and waiting for law enforcement to do their come do their job, and the guy ends up dying, na prison be your name.
Christianity Etc › Re: Man Chooses ₦10M Over Adeboye’s Prayer (Video) by turmacs(f): 9:36am On Jun 20, 2024
dragunov:
You can say whatever you like to Adeboye, but do not blaspheme against the name of Christ.
Both christ and his father, and the holy spirit, infact all of them in that their useless trinity are bastard idiots and it will not be well with them and all the hosts of heaven, tell him i said so, he should do his worst.
Programming › This Was a Jane Street interview question by turmacs(op):
If you hate/don't know math, kindly close this thread now smiley
For those of you that hope to work at Hedge fund companies, Jane Street, Citadel or other trading firms, expect stuff's like these at your interviews smiley

If you can't solve it and would like to know how to solve it, kindly quote me so I'd know that somebody is interested in the solution and I would drop the solution with explanations here.

Problem statement
Let us call the Euclidean mean of a permutation P the value of the expression |P1 - 1| + |P2 - 2| +....+ |Pn - n|.
As an example, for the permutation [1,2,3], the Euclidean mean is |1 - 1| + |2 - 2| + |3 - 3| = 0, and for the permutation [3,1,2],
the Euclidean mean is |3 - 1| + |1 - 2| + |2 - 3| = 2 + 1 + 1 = 4.

Given two whole numbers n and k, as inputs, Find a permutation P of length n such that it's Euclidean mean is equal
to k, or report that no such permutation exists.

A permutation of length n is an array of n distinct integers that contains integers from 1 to n in random
order. For example [2,4,1,3] is a permutation of length 4, but [3,3,1] is not a permutation because 3 appears
twice in the array, and [1,3,7] is also not a permutation because n = 3 but there is 7 in the array.
Also note that |x - y| represents the absolute value of x - y.

Input
The first line consists of an integer t (1 ≤ t ≤ 104) ---- The number of test cases.
The only line of each test case consists of two integers n and k (1 ≤ n ≤ 2⋅105, 0 ≤ k ≤ 1012), the length
of the permutation and the required Euclidean mean.

Output
For each test case if no such permutation exits, output "No". Otherwise, in the first line, output "Yes", and in the second line, output
n distinct integers P1,P2,…,Pn (1 ≤ pi ≤ n) ----- A suitable permutation..
If there are multiple solutions, you can output any of them.

Example
Input
8
3 4
4 5
7 0
5 16
8 14
112 777
5 12
5 2
Output
Yes
3 1 2
No
Yes
1 2 3 4 5 6 7
No
Yes
8 2 3 4 5 6 1 7
No
Yes
5 4 3 1 2
Yes
2 1 3 4 5
Christianity Etc › Re: Man Chooses ₦10M Over Adeboye’s Prayer (Video) by turmacs(f): 7:46pm On Jun 17, 2024
Toluwanise247:
God of heaven witness today against you,how you called our lord Jesus useless” As from today you shall be useless on earth and in heaven. 🙏
Let God of heaven go to hell, let him die there. Please pray for Nigeria to get better, because if that your dead God was alive, with all the useless servants he has on earth an in heaven, africa will not be like this because nobody loves that your idiotic God like africans.
Christianity Etc › Re: Man Chooses ₦10M Over Adeboye’s Prayer (Video) by turmacs(f): 7:04pm On Jun 17, 2024
Toluwanise247:
You are bastard for mentioning Jesus . Why will you drag Jesus into this
Jesus is a useless idiot, the son of an even more useless idiot. They are all part of the useless trinity including the bastard holy spirit. It will not be well with jesus and all the three bastards that are part of the nonsensical trinity.
Christianity Etc › Re: Man Chooses ₦10M Over Adeboye’s Prayer (Video) by turmacs(f): 6:21pm On Jun 17, 2024
Sirchiboy:
Are you insulting my papa
Your papa is part of the problems of this country
Christianity Etc › Re: Man Chooses ₦10M Over Adeboye’s Prayer (Video) by turmacs(f):
Even adeboye would not choose himself over 10M. Na 30 pieces of silver them use buy him oga sef
Crime › Re: Breaking!!!! Peter Obl Shot Dead In His Convoy in Onitsha by turmacs(op): 10:59am On Jun 17, 2024
Oraclebet1:
It's real
It's not peter Obi ohh..
Programming › Re: You Guys Will Love This Problem by turmacs(op): 10:44am On Jun 17, 2024
Shomek:
She never see solution drop since
Solution posted 😒
Programming › Re: You Guys Will Love This Problem by turmacs(op):
Solution
This problem is just basic math.
if b ≤ a, then the answers is obviously n * a because it would be optimal for tensazangetsu20 to sell all the breads at a price of a naira each.

But if b > a, then you have to consider 2 scenarios. Scenario 1 is when the difference between the promotional price b and the usual price a ( i.e (b-a)) is greater than or equal to the number of breads n, if that is the case, then since he will sell each of the i (from 1 to n) breads for b-i+1, as you go from bread 1 to bread n, you would notice that you get a arithmetic sequence that goes from b all the way to b-n-1. The first term of this sequence is b and the last term is b-n-1 and since b - a > n, it would ensure that as the sequence reduces as i increases from 1 all the way to n, the sequence will never be equal to a, the usual price of a bread. Then all you have to do is to find the sum of the arithmetic series from b all the way to b-n-1.
That can be done with the formular - (n*(b+(b - (n-1))))/2, where n is the number of terms or in this case, the number of breads, b is the first term, and (b-(n-1)) is the last term.

Scenario 2 is when b-a is less than the number of breads. In this case, as the sequence goes from 1 to n, at some point it's going to be equal to a , the usual price of the breads. More specifically, only the first b-a breads from 1 to n will be sold for b-i+1 naira each, the rest (n - (b-a)) breads will be sold at the usual price of a naira each. Because when you go from 1 to n, you get to a certain point where (b-i+1) starts to become less than the usual price a. Then all you do in this case is to use the formular
(b-a * (b + (b - ( (b-a) - 1))))/2) to get the sum of prices of the first b-a breads, the the price of the rest (n-(b-a) becomes a*(n-(b-a)). When you add the two together, you get your answer.

C++ Solution
#include <iostream>
using namespace std;
void paveway(){
long long n , a , b; cin >> n >> a >> b;
if( b <= a) cout << n * a << endl; else{
if( b - a >= n){
long long ans = (n * (b + (b-(n-1))))/2;
cout << ans << endl;
}else{
long long s = b - a; long long ant = ((s * (b + (b - ( s - 1))))/2) + a * (n - s);
cout << ant << endl;
}
}
}
int main (){
ios::sync_with_stdio(false);
cin.tie(nullptr);
//long long t = 1;
long long t; cin >> t;
for( ;t--; )
paveway();
return 0;
}


Sorry for the long explanation.

1 2 3 4 5 6 7 8 9 10 (of 24 pages)