{"push_id":1671745672,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"365c13c2a7b327f2781bea334f5b6d4d81a6843a","before":"a851309c83e0184a6d774846a5f5f8d837c87104","commits":[{"sha":"365c13c2a7b327f2781bea334f5b6d4d81a6843a","author":{"name":"ssccinng","email":"9be73554ee5bb77583884901ffef148b94a953cd@163.com"},"message":"How Many Nines\n\nIf we represent a date in the format YYYY-MM-DD (for example, 2017-04-09), do you know how many 9s will appear in all the dates between Y1-M1-D1 and Y2-M2-D2 (both inclusive)?\r\n\r\nNote that you should take leap years into consideration. A leap year is a year which can be divided by 400 or can be divided by 4 but can't be divided by 100.\r\nInput\r\n\r\nThe first line of the input is an integer T (1 ≤ T ≤ 105), indicating the number of test cases. Then T test cases follow. For each test case:\r\n\r\nThe first and only line contains six integers Y1, M1, D1, Y2, M2, D2, their meanings are described above.\r\n\r\nIt's guaranteed that Y1-M1-D1 is not larger than Y2-M2-D2. Both Y1-M1-D1 and Y2-M2-D2 are between 2000-01-01 and 9999-12-31, and both dates are valid.\r\n\r\nWe kindly remind you that this problem contains large I/O file, so it's recommended to use a faster I/O method. For example, you can use scanf/printf instead of cin/cout in C++.\r\nOutput\r\n\r\nFor each test case, you should output one line containing one integer, indicating the answer of this test case.\r\nSample Input\r\n\r\n4\r\n2017 04 09 2017 05 09\r\n2100 02 01 2100 03 01\r\n9996 02 01 9996 03 01\r\n2000 01 01 9999 12 31\r\n\r\nSample Output\r\n\r\n4\r\n2\r\n93\r\n1763534\r\n\r\nHint\r\n\r\nFor the first test case, four 9s appear in all the dates between 2017-04-09 and 2017-05-09. They are: 2017-04-09 (one 9), 2017-04-19 (one 9), 2017-04-29 (one 9), and 2017-05-09 (one 9).\r\n\r\nFor the second test case, as year 2100 is not a leap year, only two 9s appear in all the dates between 2100-02-01 and 2100-03-01. They are: 2017-02-09 (one 9) and 2017-02-19 (one 9).\r\n\r\nFor the third test case, at least three 9s appear in each date between 9996-02-01 and 9996-03-01. Also, there are three additional nines, namely 9996-02-09 (one 9), 9996-02-19 (one 9) and 9996-02-29 (one 9). So the answer is 3 × 30 + 3 = 93.","distinct":true,"url":"https://api.github.com/repos/ssccinng/contest_code/commits/365c13c2a7b327f2781bea334f5b6d4d81a6843a"}]}
{"actor":{"display_login":"ssccinng"}}