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 ≤ 109.
- 1 ≤ d ≤ 20,000.
hide comments
pranoym14:
2016-07-27 15:05:24
Why there is a TLE error given by using C ? |
|
sriankit:
2013-07-02 14:35:01
what will be ans for
|
|
:D:
2010-12-30 06:20:17
It's five. Why would it be one? |
|
saibharath:
2010-12-29 19:23:52
I HAVE A DOUBT.
|
|
Karpovych Artem:
2009-07-19 14:18:42
How many test cases in this problem? Only one?
|
|
Vaibhav :
2009-07-17 12:04:41
Hi, are we supposed to return the first location of the digit x? This is what I understand:
|
|
piyifan:
2009-07-17 03:42:33
Can x>9 or x<0?
|
Added by: | AnhDQ |
Date: | 2009-07-16 |
Time limit: | 0.100s-1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ERL JS-RHINO NODEJS PERL6 VB.NET |
Resource: | Mr Tuan Khuc Anh - NTU (Singapore) |