 What's up guys my name is Michael and welcome to my YouTube channel today. We are going to do This is just a screencast of code forces round 667 It's gonna start soon. So Yeah, I'm not actually gonna talk at all during this Cuz like I have been practicing though. I have been so maybe I could solve the first one in a few Probably hopefully under 10 minutes. That's what I try to practice for. Oh Man, I'm a little bit tired. So let's just do this Okay, we're gonna Excuse me is okay. It is recording. Hey, let's see That's not work. Um You just brute force this though. Um, let's see. Okay. No, that's alright. It's alright But what do you want me to run? Oh, it's okay You want to eat the salad chocolate or back down Or you already have my mind to oh, I don't I don't think it matters You don't matter. So you can eat anything now. No, actually, I Stop trouble cheery You're still trouble. Do you think you can eat salad or noodle? No, no, I don't think I could eat noodles So you so you can eat noodle cannot Oh, you cannot cannot so what do you can hear the break? No, no, just just Soggy stuff. I don't know how about my soup. Yeah, I could eat mashed potatoes. So I can You can eat the mashed potatoes. Yes, so I can make a mistake. Then you'll eat the mashed potato. Yeah, sure Oh my god, I think this works, but I'm not totally sure though. Yeah, it worked. Okay. That's good You just subtract by n both of them. Oh, they're both greater than zero. Okay, that's good Can they be negative? Oh, they can't okay? Let me see your standings Okay, okay A minus x is the one that you have to increase it by Or decrease it by you can't be more than n times Um Try to think this A minus x You should go to the next problem. I probably could do the next problem actually Ah, whatever. I'll try to figure this next math problem. Then I'll figure the other one You know you do it no more than n times so maximum so if I pick so if I subtract one from Okay, if I do a minus x that's the number of times I'm decreasing a and that means that Is x less than n though? Because if x is not less than n, okay, um Like if you decrease like if you're decreasing this number times so A minus x that's the amount of times I'm going to decrease a That a minus x that number of times so then b the maximum b can decrease would be um n minus a minus x Assuming x doesn't go past n. I don't think this would work. Yeah, it doesn't work. Um, I need to again test cases a now is going to equal to x b we're going to subtract b minus equal to a minus a bound Let's do like copy x copy a Okay, um Yeah, okay, then do like a product Okay, this should work. Uh, we still have to think about the other cases here and here though So if this is a case where a n is um Less than a times b bound. So if n is less than a times b bound You can only subtract maximum of n So if uh, let's see if n was two Yeah So if n was Yeah, okay, you would only be able to subtract by I think this would work Okay, so okay the first one's wrong second one's right. Uh, this is wrong for some reason Why am I off by one? That's weird. Okay. This is right That's wrong. That's wrong. Okay Why is seven wrong? That's the first one wrong some bug issue Oh crap. Okay. If b bound is greater than Ten minus five is five five is greater than three So I only could do the three Actually, let's see Hold up. Wait a minus x is Ten minus two is eight No, ten ten ten minus two it is ten minus Eight is two minimum Of three and two ten minus e bound is five n minus the minimum of Just copy a Think this would work. I don't know though. No Why why isn't it working? Why does this go negative? Ten one ten ten eight five three one ten ten eight five three a bound is two n is three n minus three minus, uh, two which would be just one b minus one would give us nine Why don't these update? Why is it nine? Oh, you got to change a to b x now Should be this should be easy. This should should be good Okay, so we should have 72 and why is this five? Should not be five Oh my gosh You cannot change it to five Uh, this way you have to subtract equal by a bound and Yeah, I think that would work Let's see eight nine right ten and seven. Yeah, that's right. Okay Uh 70 77 why is this negative? So we're getting part of it, right getting most of it, right? We just have this one. That's wrong I think the n is too big. Oh damn. Okay. Uh, we still how long have I been stuck on this problem? Okay, where's the part where I subtract n? So either this one it's too large by this one That's over here. I think it was third test case Okay, uh, this is actually getting kind of annoying. So I'm actually going to put this over here because I can't Can actually see any of the I can't see any local variables That's what I wanted to do We got to do a max of this and why B can't decrease so much The min no not max the min of this and why And then this one's the same thing. We can't they have to do the minimum Of this and x one eight. Is that right? No, it's one seven seven one seven seven We're close though ab x y and ab x y and wait ab x y Come on you can do this b minus y four One eight one seven two is wrong b should be Hold up. Hold up. Hold up Why is b four? minimum of n minus How did we get b equal to four? b bound is four abound abound is uh, fuck 7800 which is less n minus 7800 with this is 11,500 the minimum of this one and y would be 39 So y should be b should be 39 Why is b four? Oh B bound Yeah, I think this would work one seven seven one seven seven. Yeah. Yeah, okay uh 70 77 one seven seven one seven seven I think that's right I think that's worth 55 cent. Yeah, okay. I think this would work It did take a long time though Yeah, it worked. Okay um See my standing Got up to 8,005. It's pretty good How's it guys this guy? Um, let's see if we could solve one more I think we probably can Try harder n x y Okay, so we have n and an x y. Okay uh If I don't need ab anymore just pass in n x y Okay, uh, what do you have to do? I don't know the array, but you have to restore it. However, you know the facts about the array There's n distinct positive integers. Okay It contains two elements x and y These elements are known for you Okay, if you sort the x degree in increasing order, okay Um difference between all consecutive elements are equal In increasing order, okay If we prove that any other exists, right Among all these satisfy you must We ask you to restore one that which has a minimum maximum Minimum possible maximum element Minimize the maximum element Okay, um Consists of n distinct positive. So they're all different x is less than y Can we just take y minus x and divide by n? And increment that over time n Wait, the first one is to oh Yeah, um 49 minus 1 That's 48. It's 1 plus 48 It's two elements. You could just print out The two elements So if n is equal to two, okay, so Can it be just one element? No, it has to be two. Okay. Um, Let's see 20 40 30 50 you 10 5 8 minus 3 is 5 8 minus 3 is 5 5 divided by 2 2.5 Can I go every two three plus two plus two Feeling we could solve one more. I actually have a feeling we could actually solve one more. Um This guy's good. I think I got it. Hold up 20 Yeah, I got it. Okay. Oh So we have let's see 1 2 3 4 5 Shit, that's not right 50 minus 6 So if it's 6 and it's 20 for the 6 and 20 if we do 20 50 They're incrementing by 6 20 is the smallest number so we have 20 How do I get 6 15 minus 20 30 divided by 6 No divided by 5 This is this is this is not hard. This is not hard. I could definitely do this. I could definitely do this. Um 22 minus 13 Is 9 divided by 9 I could get you 1 that's not right I want 9 of them. Oh, they went by 3 Any sense? They did 1 3 4 This is 10 13 16 19 22 24 I think this works 149 10 20 30 40 50 26 32 20 30 8 40 40 Ah shit, this is not right 1 2 3 4 5 6 7 ah Um 26 32 48 38 44 50 The number's already reached and we don't have to print it out. Okay. Um So if 1 2 3 4 5 6 Why did it do why did it do 3 5 5 3 8? Oh, what the 10 20 30 40 50 26 32 20 28 44 50 3 5 3 8 gives you 5 3 8 5 3 8 gets you 3 8 plus 5 plus 5 You should have continued 13 16 Okay, wait, I have 35 minutes left. I could I could definitely do this. Um You just do why you didn't make this a while loop if x minus Kill me right now 5 20 40 20 30 40 50 10 Um keep doing 6 20 Oh 6 20 fish 5 23 50 gives us 20 26 5 3 8 gives us uh 3 8 23 18 3 8 Yeah, I think this would work. Uh, there's something wrong with the spacing 6 7 8 9 I'll eat soon. I'm doing a contest Wait Wrong answer on two damn Um, what is what is the problem? What if I try 50 50 and is 50? Ah, that's not right Okay, um I'm doing a contest right now. I said that like It ink is 10 If ink is zero is zero If you do 50 50 50 50 50 50 Okay, it was 50 50 50 If ink is zero, that means they're the same so we just set ink to set it to x Yeah Yeah, I'll try this Still wrong. Okay, um Yeah, I don't know tried Really tried Apparently you get points deducted if you should get it wrong for each test case Yep, I don't know I'm gonna go eat food now Yeah, maybe I'll try to up solve this later rake.com. Subscribe. I'll check you guys later. Peace