Problem:
 Score : 100 points    Problem Statement There are three houses on a number line: House 1 , 2 and 3 , with coordinates A , B and C , respectively.
Print Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.      Constraints  0\leq A,B,C\leq 100  A , B and C are distinct integers.         Input Input is given from Standard Input in the following format:  A  B  C       Output Print Yes if we pass the coordinate of House 3 on the straight way from House 1 to House 2 without making a detour, and print No otherwise.        Sample Input 1 3 8 5      Sample Output 1 Yes  We pass the coordinate 5 on the straight way from the house at coordinate 3 to the house at coordinate 8 .       Sample Input 2 7 3 1      Sample Output 2 No       Sample Input 3 10 2 4      Sample Output 3 Yes       Sample Input 4 31 41 59      Sample Output 4 No

Solution (Python):

import sys
INF = float("inf")


def yes():
    print("Yes")  


def no():
    print("No")  


def solve(A: int, B: int, C: int):
    if (A <= C and C <= B) or (B <= C and C <= A):
        yes()
    else:
        no()
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    solve(A, B, C)


if __name__ == '__main__':
    main()

Solution (Python):


import itertools
from collections import Counter
from collections import defaultdict
import bisect

def main():
    A, B, C = map(int, input().split())
    if A < C < B or B < C <A:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy
import collections
from operator import itemgetter

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("+")
    elif (x<y): print("-")
    else: print("?")

def ip():
    return int(input())
def printrow(a):
    for i in range(len(a)):
        print(a[i])
def combinations(n,r):
    if n<r:return 0
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
def permutations(n,r):
    if n<r:return 0
    return math.factorial(n) // math.factorial(n - r)

a,b,c= (int(i) for i in input().split())       








if a<=c and c <= b or b<=c and c <=a: j(1)
else: j(0)

Solution (Python):
A, B,C = map(int, input().split())

Anything= 'Yes' if (A<C and C<B) or (B<C and C<A) else 'No'
print(Anything)

Solution (Python):
A, B, C = map(int, input().split())
if A < C < B or B < C < A:
  print("Yes")
else:
  print("No")

Solution (Python):
A, B, C = [int(i) for i in input().split()]
print('Yes' if A <= C <= B or B <= C <= A else 'No')

Solution (Python):
a, b, c = map(int, input().split())
print("Yes" if a <= c <= b or b<= c <= a else "No")

Solution (Python):


A,B,C= map(int,input().split())
if A <=C <=B or B<=C <=A:
    print('Yes')
else:
    print('No')

Solution (Python):

a, b, c = map(int, input().split())

if a < c < b or b < c < a:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b,c=map(int,input().split())
if c>min(a,b) and c<max(a,b):
    print("Yes")
else:
    print("No")

Solution (Python):
a,b,c=list(map(int,input().split(" ")))
if a<c and c<b or a>c and c>b:
  print("Yes")
else:
  print("No")

Solution (Python):
A, B, C = [int(x) for x in input().split()]
if A < C < B or  A > C > B:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b,c = map(int, input().split())

if (a < c and c < b) or (b<c and c < a):
    print("Yes")
else:
    print("No")

Solution (Python):
A,B,C = map(int,input().split())

if (B < C and C < A) or (A<C and C < B):
    print('Yes')
else:
    print('No')

Solution (Python):
[a,b,c] = [int(i) for i in input().split()]
if (a<= c and c <= b) or (b<= c and c <= a):
    print("Yes")
else:
    print("No")

Solution (Python):
def main():
	A, B, C = map(int, input().split())
	if (A < C and C < B) or (B < C and C < A):
		print("Yes")
	else:
		print("No")

if __name__ == '__main__':
    main()

Solution (Python):
a, b, c  = map(int, input().split())

if a < c and c < b:
    print('Yes')
elif b < c and c < a:
    print('Yes')
else:
    print('No')

Solution (Python):
a, b, c = map(int, input().split())
print("Yes" if a<c<b or b<c<a else "No")

Solution (Python):
A, B, C = map(int, input().split())

if A <= C and C <= B:
    print('Yes')
elif B <= C and C <= A:
    print('Yes')
else:
    print('No')

Solution (Python):


a,b,c = map(int,input().split())

if (a <= c <= b) or (b <= c <= a):
    print("Yes")
else:
    print("No")

Solution (Python):
A,B,C = map(int,input().split())
if A <= C <= B or B <= C <= A:
    print("Yes")
else:
    print("No")

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    A, B, C = map(int, input().split())

    A, B = min(A, B), max(A, B)
    if A <= C <= B:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    print(main())

Solution (Python):
a,b,c=map(int,input().split())
if a<c<b:
    print("Yes")
elif b<c<a:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b,c = map(int,input().split())

if a<c<b or a>c>b:
    print("Yes")
else:
    print("No")

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A,B,C=MAP()

if A<=C<=B or B<=C<=A:
    Yes()
else:
    No()

Solution (Python):
A,B,C = map(int, input().split())

if min(A, B) <= C and C <= max(A,B):
    print('Yes')
else:
    print('No')

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

A, B , C = MAP()

if A<= C <= B or B<=C<=A:
	print("Yes")
else:
	print('No')

Solution (Python):
import math
from operator import itemgetter
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

a,b,c = IL()
if a <= c <= b or a >= c >= b:
	print("Yes")
else:
	print("No")

Solution (Python):
a,b,c=map(int,input().split())
if a>c>b or a<c<b:
    print('Yes')
else:
    print('No')

Solution (Python):
a, b, c = map(int, input().split())
if a <= c and b >= c:
    print("Yes")
elif b <= c and a >= c:
    print("Yes")
else:
    print("No")

Solution (Python):
a, b, c = map(int,input().split())
if a <= c <= b or b <= c <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
A,B,C = map(int,input().split())

if A<C and C<B:
    print("Yes")
elif B<C and C<A:
    print("Yes")
else:
    print("No")

Solution (Python):
a,b,c=map(int,input().split())
print("Yes" if a<c<b or b<c<a else "No")

Solution (Python):
a,b,c=map(int,input().split())
if a<=c<=b or b<=c<=a:
  print("Yes")
else:
  print("No")

Solution (Python):
A, B, C = map(int,input().split())
if A<C<B:
    print('Yes')
elif B<C<A:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b,c=map(int,input().split())
print("Yes"if min(a,b)<=c<=max(a,b)else"No")

Solution (Python):
A,B,C=[int(i) for i in input().split()]
print("Yes" if (A-C)*(B-C)<0 else "No")

Solution (Python):
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

a, b, c = nm()

if a <= c <= b:
    print('Yes')
elif b <= c <= a:
    print('Yes')
else:
    print('No')

Solution (Python):
a,b,c=map(int, input().split())
print("Yes" if a < c and c < b or b < c and c < a else "No")

Solution (Python):
A, B, C = [int(_) for _ in input().split()]

if A < C < B or A > C > B:
    print("Yes")
else:
    print("No")

Solution (Python):


a = list(map(int, input().split()))
print('Yes' if sorted(a)[1] == a[2] else 'No')

Solution (Python):
a, b, c = map(int, input().split())

print("Yes" if a < c < b or a > c > b else "No")

Solution (Python):
a,b,c = map(int, input().split())
print('Yes' if a <= c <= b or b <= c <= a else 'No')

Solution (Python):
a, b, c = (int(i) for i in input().split())


if (a<c and c<b) or (b<c and c<a):
    print("Yes")
else:
    print("No")

Solution (Python):
A, B, C = list(map(int, input().split()))

if A <= C and C <= B or B <= C and C <= A:
    print('Yes')
else:
    print('No')

Solution (Python):
a, b, c = map(int, input().split())
if a < c < b or b < c < a:
	print("Yes")
else:
	print("No")

Solution (Python):
A, B, C = map(int, input().split())
if (A - C) * (B - C) < 0:
    print("Yes")
else:
    print("No")

Solution (Python):
A, B, C = map(int, input().split())
print('Yes' if A < C < B or B < C < A else 'No')

Solution (Python):
a,b,c=map(int,input().split())
if a<c<b: print("Yes")
elif a>c>b: print("Yes")
else: print("No")

Solution (Python):
a,b,c=map(int,input().split())
a,b=min(a,b),max(a,b)
if a<=c<=b:
  print('Yes')
else:
  print('No')