Efficient Grading

시간 제한1초메모리 제한2048 MB

요약
시험 n개와 한 시험을 채점하거나 조교 한 명을 교육하는 데 걸리는 시간 t가 주어질 때, 모든 채점을 끝내는 최소 시간과 그 시간 안에 끝내는 데 필요한 최소 채점자 수를 구한다.
난이도

보통10점 중 6점

유형
수학, 그리디, 이분 탐색
정답자
아직 제출이 없습니다

문제

You are the new responsible instructor for the newest course at TU Delft: Financial Project Coordination (FPC). The course went smoothly throughout the quarter, but now you are faced with a new challenge: you have a multitude of exams to grade. You want to finish the exams as quickly as possible before your new course starts. Luckily for you, you can employ some teaching assistants (TAs) to help out. For each TA that you employ, you need to spend some time giving them a quick training, by quickly going through an example exam. As a result, a trained TA can, in turn, grade exams as well and can also train other TAs. The time you spend training is the same as the time you could spend grading.

With this in mind, you need to find out 2 things. Firstly, what is the minimum amount of time needed to grade all exams? Secondly, what is the minimum number of graders needed to achieve this time?

입력

The input consists of a single line containing two integers:

  • nn (1≤n≤1061\leq n\leq 10^6), the number of exams to grade.
  • tt (1≤t≤1091\leq t\leq 10^9), the amount of time needed to grade an exam or train a TA.

출력

Output a single line, with 2 space-separated numbers:

  • The minimum amount of time needed to grade all exams.
  • The minimum number of graders (yourself plus the number of trained TAs) needed to finish grading within the minimum amount of time.

예제2

  1. 예제 1

    입력
    4 2
    
    예상 출력
    6 2
    
  2. 예제 2

    입력
    100 100
    
    예상 출력
    800 36