ARITHSEQ  Arithmetic sequence
English  Tiếng Việt 
Given an arithmetic sequence a, a + d, a + 2*d, ..., a + n*d.
Request
Count the number of digit x appearing in the given sequence.
Input
 A line containing a, d, n, x.
Output
 The result found.
Example
Input: 10 5 2 0 Output: 2
Limitations
 1 ≤ a, n ≤ 10^{9}.
 1 ≤ d ≤ 20,000.
hide comments
pranoym14:
20160727 15:05:24
Why there is a TLE error given by using C ? 

sriankit:
20130702 14:35:01
what will be ans for


:D:
20101230 06:20:17
It's five. Why would it be one? 

saibharath:
20101229 19:23:52
I HAVE A DOUBT.


Karpovych Artem:
20090719 14:18:42
How many test cases in this problem? Only one?


Vaibhav :
20090717 12:04:41
Hi, are we supposed to return the first location of the digit x? This is what I understand:


piyifan:
20090717 03:42:33
Can x>9 or x<0?

Added by:  AnhDQ 
Date:  20090716 
Time limit:  0.100s0.136s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  Mr Tuan Khuc Anh  NTU (Singapore) 