Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

DEMSO - Đếm số

For a natural number in the decimal number system, we define a bad position is a position in which the corresponding digit and the next digit is differenced by no more than D. If a number has no more than K bad positions, we call it a beautiful number.

Your task is to count the beautiful numbers in the interval (A, B).

Input

A single line consisting of four integers A, B, D, K.

Output

A single line consisting of the number of beautiful numbers in the interval (A, B).

Constraint

1 ≤ A ≤ B ≤ 1015

Example

Input
1 13 1 0

Output
10

Được gửi lên bởi:VOJ problem setters
Ngày:2008-06-07
Thời gian chạy:1s
Giới hạn mã nguồn:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:Tất cả ngoại trừ: ERL GOSU JS-RHINO NODEJS PERL6 PYPY RUST SED VB.NET
Nguồn bài:VNOI Marathon '08 - Practice Round
Problem Setter: Khúc Anh Tuấn

hide comments
2020-07-26 03:38:05
Đáng ra là one hit, nhưng viết nhầm s thành p mất 2 đấm :((((
2019-09-18 03:22:11
cho xin bộ test với
2019-09-18 03:13:26
bai nay de
duonght_pro_xinhgainhathemattroi_:)
2019-05-24 11:25:34
trâu cũng AC
2018-08-02 17:57:00
Dành cho ai cần :3
http://bit.ly/2RjUBas

Last edit: 2019-01-11 17:40:59
2016-07-27 06:12:06
đệ quy cơ bản
2015-11-26 16:58:35 xin đừng quên tôi
qhđ cơ bản
2015-09-03 16:45:48 Nguyễn Vĩnh Thịnh
duyệt
2015-08-14 15:53:06
test tình sai rồi AD @@
2015-07-07 11:15:28 nhinhi
khong hieu gi de ca
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.