extern crate core;

use std::fmt;
use std::cmp::Ordering;
use std::fmt::{Display, Error, Formatter};
macro_rules! read_line{
    () => {{
        let mut line = String::new();
        std::io::stdin().read_line(&mut line).ok();
        line
    }};
    (delimiter: ' ') => {
        read_line!().split_whitespace().map(|x|x.to_string()).collect::<Vec<_>>()
    };
    (delimiter: $p:expr) => {
        read_line!().split($p).map(|x|x.to_string()).collect::<Vec<_>>()
    };
    (' ') => {
        read_line!(delimiter: ' ')
    };
    ($delimiter:expr) => {
        read_line!(delimiter: $delimiter)
    };
    (' '; $ty:ty) => {
        read_line!().split_whitespace().map(|x|x.parse::<$ty>().ok().unwrap()).collect::<Vec<$ty>>()
    };
    ($delimiter:expr; $ty:ty) => {
        read_line!($delimiter).into_iter().map(|x|x.parse::<$ty>().ok().unwrap()).collect::<Vec<$ty>>()
    };
}
macro_rules! let_all {
    ($($n:ident:$t:ty),*) => {
        let line = read_line!(delimiter: ' ');
        let mut iter = line.iter();
        $(let $n:$t = iter.next().unwrap().parse().ok().unwrap();)*
    };
}
fn main(){
    let_all!(w: f64, h: f64, v: f64, t: f64, x: f64, y: f64, p: f64, q: f64);
    let start = Point{x: x, y: y};
    let mut n = 0;
    let mut result = 0;
    while let Some(RangeF64{lower, upper}) = cal_y_range(&start, if n % 2 == 0 {
        p + n as f64 * w
    }else {
        n as f64 * w + w - p
    }, v * t) {
        //println!("n = {}, lower = {}, upper = {}", n, lower, upper);
        let le = ((lower - q) / 2_f64 / h);
        let ue = ((upper - q) / 2_f64 / h);
        if le < ue {
            //println!("n = {}, lower = {}, upper = {}", n, le, ue);
            result += (ue.floor() - le.ceil() + 1_f64) as i64;
        }
        let lo = ((lower + q - 2_f64 * h) / 2_f64 / h);
        let uo = ((upper + q - 2_f64 * h) / 2_f64 / h);
        if lo < uo {
            //println!("n = {}, lower = {}, upper = {}", n, lo, uo);
            result += (uo.floor() - lo.ceil() + 1_f64) as i64;
        }
        n += 1;
    }
    n = -1;
    while let Some(RangeF64{lower, upper}) = cal_y_range(&start, if n % 2 == 0 {
        p + n as f64 * w
    }else {
        n as f64 * w + w - p
    }, v * t) {
        //println!("n = {}, lower = {}, upper = {}", n, lower, upper);
        let le = ((lower - q) / 2_f64 / h);
        let ue = ((upper - q) / 2_f64 / h);
        if le < ue {
            //println!("n = {}, lower = {}, upper = {}", n, le, ue);
            result += (ue.floor() - le.ceil() + 1_f64) as i64;
        }
        let lo = ((lower + q - 2_f64 * h) / 2_f64 / h);
        let uo = ((upper + q - 2_f64 * h) / 2_f64 / h);
        if lo < uo {
            //println!("n = {}, lower = {}, upper = {}", n, lo, uo);
            result += (uo.floor() - lo.ceil() + 1_f64) as i64;
        }
        n -= 1;
    }
    println!("{}", result);
}
struct Point {
    x: f64, y: f64
}
struct RangeF64 {
    lower: f64, upper: f64,
}
trait Math {
    fn absolute(&self) -> Self;
}
impl Math for f64 {
    fn absolute(&self) -> Self {
        if self < &0_f64 {
            -*self
        }else {
            *self
        }
    }
}
fn cal_y_range(from: &Point, x: f64, distance: f64) -> Option<RangeF64> {
    let dx = (x - from.x).abs();
    if dx <= distance {
        let dy = (distance * distance - dx * dx).sqrt();
        Some(RangeF64 { lower: from.y - dy, upper: from.y + dy})
    }else {
        None
    }
}


Measured memory_bytes: 5132