 Alright guys, so we're gonna go over the recent code forces problem. This is the division to a problem so you're given the values a b c d and the condition basically of the problem is just that um the problem is really really boils down to this let me just write these write it down so the problem just boils down to this which is the does there exist a condition given a b c d where both of these are true right the um all the values of xi which is just like any of the any value you choose from is between we know that's between a minus b and a plus b so our does there exist values such that both of these statements are true okay so pretty much given like given a b c d so to do this it's actually not that hard first of all let's let's just rewrite this summation of n from i equals 1 to n of xi and we know xi is constant it's like a regular constant because like we know we're given this right we're given this xi it's like any any constant that you have you're just multiplying it so so let's let's formulate what this xi is so if um from your math equations you know that if xi is a constant we know that we could pretty much just take the xi out and just multiply n times xi right because this is just summing up 1 to n of xi every single time so then we could just multiply 1 to n by xi right this summation that's what it that's what the summation is so now that we have this summation let's just factor out the equation of this so in let's think about this pretty much in what scenario can both of these statements not be true right what scenario can both of these statements not be true right so we know that a b c d are integers right and we need to make sure that both of these statements are true right so and xi is just like any any value uh any index of each grain right any grain so uh pretty much the only way this condition could be false both of these could be false is if a minus b summation of a minus b is actually greater than the upper bound as possible or the upper bound of a plus b is actually less than the lower bound of c minus d right so let's just sum that up let's let's calculate the upper and lower bound of a minus b and a plus b so let's do summation of i equal 1 to n of a minus b so this is a lower bound we find the lower bound it's just n times a minus b and then if we find the summation of the upper bound it's just equal to n times a plus b right so we know the now we know the equations of n and a both of the upper the lower bound and the upper bound so this is lower and upper bound so after we know we know the equations of both of these all we have to do is just check if the this equation doesn't satisfy uh the this this equation so the case is where it's not possible is if the lower bound is greater than the upper bound right the lower bound of xi is greater than the upper bound the summation of xi of c plus d so that'll just be if if n times a minus b is greater than the upper bound of c plus d so that's not possible or the upper bound uh the upper bound of xi is smaller than c minus d and what's the upper bound of xi uh a plus b that's n times a a plus b right upper bound of xi and that's n times a plus b is uh less than the lower bound of c minus d so yeah so if any of these conditions are true then that both of these conditions are true that means it's not possible it's either this is not true or this is not true then it's not possible otherwise it's possible right that they're in the right ranges right so uh yeah that's pretty much how you do this problem this problem just boils down whether uh your values are in the right ranges okay you're just checking if the boundaries are in between it or not so that's the that's what this problem problem boils down to okay um yeah i'll just show you the code right now okay so this is the code um we'll read in n and then a b c d so if a minus b times n is greater than c plus d remember that's checking that condition that was not possible then or a plus b times n is less than c minus d then we see out no otherwise we print out yes yeah and this is my integer for t which is number of test cases while t minus minus so i'll just read in n a b c d okay so yeah that's all that you need to know for this problem uh it was just checking if the bounds are possible for the summation where x i is like any number between a plus b a minus b and b and a plus b so during if the if it's in the right range and uh if it's not in the right range then you print out no if it is in the right range yeah you just print out yes so yeah that's all you have to do rate com subscribe i haven't been uploading a lot lately because of school but i'll try to get i'll try to upload every week every friday so come back next friday all right guys so yeah uh i'll just see you guys later peace