标签:
Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 10945 | Accepted: 5499 |
Description
Input
Output
Sample Input
59 237 375 743 200000 849694 2500000 8000000
Sample Output
116 28 300612 Deficit
Source
1 #include<stdio.h> 2 int s , d ; 3 4 int main () 5 { 6 // freopen ("a.txt" , "r" , stdin) ; 7 int i , earn , two; 8 while (~ scanf ("%d%d" , &s , &d)) { 9 for (i = 1 ; i < 5 ; i++) { 10 if (i * d > (5 - i) * s) 11 break ; 12 } 13 two = 0 ; 14 if (i == 4) 15 two = 1 ; 16 if (i == 5) { 17 puts ("Deficit") ; 18 continue ; 19 } 20 earn = (12 - 2 * i - two) * s - (2 * i + two ) * d ; 21 if (earn < 0) { 22 printf ("Deficit\n") ; 23 } 24 else 25 printf ("%d\n" , earn ) ; 26 } 27 return 0 ; 28 }
标签:
原文地址:http://www.cnblogs.com/get-an-AC-everyday/p/4298683.html