package main import ( "fmt" ) func main() { solve281() } func solve281() { var d, a, b, c int fmt.Scan(&d, &a, &b, &c) var cnt1, cnt2 int b1 := b if a == 0 || c == 0 { cnt1 = -1 }else{ for a <= b1 || c <= b1 { cnt1++ b1 = max(0, b1-d) if b1 == 0 { break } } } if b==0{ cnt2 = -1 }else{ a1 := a for a1 >= b { cnt2++ a1 = max(0, a1-d) if a1 == 0 { break } } c1 := c for c1 >= b { cnt2++ c1 = max(0, c1-d) if c1 == 0 { break } } if a1 == c1 { cnt2 = -1 } } //fmt.Println(cnt1, cnt2) if cnt1 == -1 && cnt2 == -1 { fmt.Println("-1") } else if cnt1 == -1 { fmt.Println(cnt2) } else if cnt2 == -1 { fmt.Println(cnt1) } else { fmt.Println(min(cnt1, cnt2)) } } func max(a, b int) int { if a < b { a = b } return a } func min(a, b int) int { if a > b { a = b } return a }