Problem:
Score : 100 points

Problem Statement

You are given three integers A, B and C.
Determine whether C is not less than A and not greater than B.

Constraints

-100≤A,B,C≤100

A, B and C are all integers.

Input

Input is given from Standard Input in the following format:

A B C

Output

If the condition is satisfied, print Yes; otherwise, print No.

Sample Input 1

1 3 2

Sample Output 1

Yes

C=2 is not less than A=1 and not greater than B=3, and thus the output should be Yes.

Sample Input 2

6 5 4

Sample Output 2

No

C=4 is less than A=6, and thus the output should be No.

Sample Input 3

2 2 2

Sample Output 3

Yes

Solution in Ruby (2.3.3) (judge verdict: Runtime Error)

require 'pp'

n, m = gets.strip.split.map(&:to_i)

data = []

m.times do
    a, b, c = gets.strip.split.map(&:to_i)
    data << {from: a, to: b, cost: -c}
end

def find_negative_loop(n, m, data)
    d = {}
    n.times { |i| d[i + 1] = 0 }
    n.times do |i|
        m.times do |j|
            e = data[j]
            from = e[:from]
            to   = e[:to]
            cost = e[:cost]
            if d[to] > d[from] + cost
                d[to] = d[from] + cost
                if i == n - 2
                    return true
                end
            end
        end
    end
    return false
end

INF = 10000000000000000000000000
def shortest_path(n, m, s, data)
    d = {}
    n.times { |i| d[i + 1] = INF }
    d[s] = 0
    while true do
        update = false
        m.times do |i|
            e = data[i]
            from = e[:from]
            to   = e[:to]
            cost = e[:cost]
            if d[from] != INF && d[to] > d[from] + cost
                d[to] = d[from] + cost
                update = true
            end
        end
        break unless update
    end
    return d
end

d = find_negative_loop(n, m, data)

if d === true
    puts 'inf'
else
    d = shortest_path(n, m, 1, data)
    puts -d[n]
end