Submission #2699522
Source Code Expand
n, a, b, k = map(int,raw_input().split(' ')) def cdiv(x,y): if x % y == 0: return x/y else: return x/y + 1 ly = [0, cdiv(k - a*n, b), -1] ry = [n, k/b, -1] if b > a: ly[2] = cdiv(k - 2*a*n , b - a) ry[2] = (k - a*n) / (b - a) else: ly[2] = cdiv(k - a*n, b - a) ry[2] = (k - 2*a*n) / (b - a) l, r = max(ly), min(ry) if l <= r: print r - l + 1 else: print 0
Submission Info
Submission Time | |
---|---|
Task | B - RGB Coloring |
User | ruhanhabib39 |
Language | Python (2.7.6) |
Score | 0 |
Code Size | 391 Byte |
Status | RE |
Exec Time | 10 ms |
Memory | 2692 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 700 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample01.txt, sample02.txt, sample03.txt |
All | sample01.txt, sample02.txt, sample03.txt, in01.txt, in02.txt, in03.txt, in04.txt, in05.txt, in06.txt, in07.txt, in08.txt, in09.txt, in10.txt, in11.txt, in12.txt, in13.txt, in14.txt, in15.txt, in16.txt, in17.txt, in18.txt, in19.txt, in20.txt, in21.txt, sample01.txt, sample02.txt, sample03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
in01.txt | WA | 10 ms | 2568 KB |
in02.txt | RE | 10 ms | 2568 KB |
in03.txt | WA | 10 ms | 2692 KB |
in04.txt | WA | 10 ms | 2692 KB |
in05.txt | WA | 10 ms | 2568 KB |
in06.txt | WA | 10 ms | 2692 KB |
in07.txt | WA | 10 ms | 2692 KB |
in08.txt | WA | 10 ms | 2692 KB |
in09.txt | WA | 10 ms | 2568 KB |
in10.txt | WA | 10 ms | 2692 KB |
in11.txt | WA | 10 ms | 2568 KB |
in12.txt | WA | 10 ms | 2692 KB |
in13.txt | WA | 10 ms | 2692 KB |
in14.txt | WA | 10 ms | 2692 KB |
in15.txt | WA | 10 ms | 2692 KB |
in16.txt | WA | 10 ms | 2568 KB |
in17.txt | WA | 10 ms | 2692 KB |
in18.txt | RE | 10 ms | 2568 KB |
in19.txt | RE | 10 ms | 2568 KB |
in20.txt | RE | 10 ms | 2688 KB |
in21.txt | RE | 10 ms | 2692 KB |
sample01.txt | WA | 10 ms | 2692 KB |
sample02.txt | WA | 10 ms | 2692 KB |
sample03.txt | WA | 10 ms | 2568 KB |