Problem:
Score : 100 points

Problem Statement

There are S sheep and W wolves.

If the number of wolves is greater than or equal to that of sheep, the wolves will attack the sheep.

If the wolves will attack the sheep, print unsafe; otherwise, print safe.

Constraints

1 \leq S \leq 100

1 \leq W \leq 100

Input

Input is given from Standard Input in the following format:

S W

Output

If the wolves will attack the sheep, print unsafe; otherwise, print safe.

Sample Input 1

4 5

Sample Output 1

unsafe

There are four sheep and five wolves. The number of wolves is not less than that of sheep, so they will attack them.

Sample Input 2

100 2

Sample Output 2

safe

Many a sheep drive away two wolves.

Sample Input 3

10 10

Sample Output 3

unsafe

Solution in Rust (1.42.0) (judge verdict: Runtime Error)

use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;

fn main() {
    input! {
        n: usize,
        m: usize,
        s: usize,
        uvab: [(Usize1, Usize1, usize, i64); m],
        cd: [(usize, i64); n],
    }
    let mut g = vec![vec![]; n];
    for (u, v, a, b) in uvab {
        g[u].push((v, a, b));
        g[v].push((u, a, b));
    }

    let inf = 1_000_000_000_000_000_000;
    let s = std::cmp::min(s, 2500);
    // let mut f = vec![vec![false; 2500 + 1]; n];
    let mut dp = vec![vec![inf; 2500 + 1]; n];
    dp[0][s] = 0;
    let mut q = std::collections::BinaryHeap::new();
    use std::cmp::Reverse;
    q.push((Reverse(0), 0, s));
    while let Some((t, v, s)) = q.pop() {
        let t = t.0;
        if dp[v][s] < t {
            continue;
        }
        for &(u, a, b) in &g[v] {
            if s >= a && t + b < dp[u][s - a] {
                dp[u][s - a] = t + b;
                q.push((Reverse(t + b), u, s - a));
            }
        }
        for i in 1.. {
            let s = s + i * cd[v].0;
            {
                let s = std::cmp::min(s, 2500);
                let t = t + i as i64 * cd[v].1;
                if t < dp[v][s] {
                    dp[v][s] = t;
                    q.push((Reverse(t), v, s));
                }
            }
            if s > 2500 {
                break;
            }
        }
    }
    for i in 1..n {
        println!("{}", dp[i].iter().filter(|&t| *t > 0).min().unwrap());
    }
}