Help me in solving NFS problem

My issue

Why will we use u2 - 2as when the formula is v2 = u**2 + 2as ??

My code

import math# cook your dish here
t=int(input())
for i in range(t):
    u,v,a,s = map(int,input().split())
    checkv = u**2 + 2*a*s
    if checkv <= v**2:
        print("Yes")
    else:
        print("No")

Learning course: Level up from 1* to 2*
Problem Link: Turn It Practice Problem in Level up from 1* to 2* - CodeChef

@pranjalasthana
cozz we are applying breaks which will provide acceleration in the opposite direction of the motion thats why it is negative.
cozz acceleration is a vector quantity.