CF721B Passwords

题目描述

## 题目大意 Vanya想去他最喜欢的名为Codehorses的网站,他平时用n个密码作为他所有网站的密码。但是这天,Vanya突然忘了他的密码。 Vanya试的所有密码中,不存在某一次长度小于上一次的长度,他每次会随机试同一长度的密码(当这种长度试完后,会试下一长度的密码)。当他试对时,会瞬间批准进入网站。 他每次输入密码需要1秒,每连续k次输错后,需要等5秒再试下一次。他输密码的过程中不会休息停顿。 准确算出他进入网站最好情况和最差情况所需要的秒数。

输入格式

第一行:输入整数n,k (1

输出格式

两个整数,分别是最好情况所需的时间和最坏情况所需的时间。

说明/提示

Consider the first sample case. As soon as all passwords have the same length, Vanya can enter the right password at the first try as well as at the last try. If he enters it at the first try, he spends exactly $ 1 $ second. Thus in the best case the answer is $ 1 $ . If, at the other hand, he enters it at the last try, he enters another $ 4 $ passwords before. He spends $ 2 $ seconds to enter first $ 2 $ passwords, then he waits $ 5 $ seconds as soon as he made $ 2 $ wrong tries. Then he spends $ 2 $ more seconds to enter $ 2 $ wrong passwords, again waits $ 5 $ seconds and, finally, enters the correct password spending $ 1 $ more second. In summary in the worst case he is able to be authorized in $ 15 $ seconds. Consider the second sample case. There is no way of entering passwords and get the access to the site blocked. As soon as the required password has length of $ 2 $ , Vanya enters all passwords of length $ 1 $ anyway, spending $ 2 $ seconds for that. Then, in the best case, he immediately enters the correct password and the answer for the best case is $ 3 $ , but in the worst case he enters wrong password of length $ 2 $ and only then the right one, spending $ 4 $ seconds at all.