프로그램 명: coci_faktor
<!-- here -->
[문제요약] 과학 논문 평가의 주요 요소는 다른 논문에 얼마나 많은 인용이 일어나는가가 주요 요소이다.
만약 38 개의 논문에 894 번의 인용이 일어났다면
- 평가 점수는 894/38 = 23.53
- 올림하면 24 이다.(항상 올림)
y 개의 논문에 x 번의 인용이 일어난 경우 주요 요소 z 를 구할 수 있다. 문제는 y , z 가 주어질 때 최소 x 를 구하는 것이다.
Impact factor of a scientific journal is a measure reflecting the average number of citations to articles published in science journals. For this task we are using a simplified formula for calculating the impact factor:
Total sum of all citations articles published in the journal recived -------------------------------------------------------------------- Total number of articles publishedRounding is always preformed up. For example the impact factor of the “Journal for ore research and time wasting” that published 38 articles quoted 894 times is 894 / 38 = 23.53 rounding up to 24.
You are the editor of one scientific journal. You know how much article you are going to publish and the owners are pushing you to reach a specific impact factor. You are wondering how many scientists you will have to bribe to cite your article to meet the owners demands. Since money is tight you want to bribe the minimal amount of scientists.
입력First and only line of input will contain 2 integers, A (1 ≤ A ≤ 100), number of articles you plan to publish and I (1 ≤ I ≤ 100) impact factor the owners require.
출력First and only line of output should contain one integer, the minimal number of scientists you need to bribe.
입출력 예input 38 24 output 875 input 1 100 output 100 input 10 10 output 91여기서 최소 x를 구하는데 왜 y*(z-1)+1 을 할까요...........
roundup(A/B)한 결과가 C라면 roundup(A/B)한 결과가 C일 A의 범위를 구해보자. A = BC일 때는 뭐 보나마나 BC/B = C니까 C일 거고. A = B(C-1)일 때는 B(C-1)/B = C-1니까 당연히 C-1이겠지. 이번엔 B(C-1) + k를 생각해 보자. 이걸 B로 나누면 C-1 + k/B가 되는데, k/B가 0이면 C-1가 되고 k/B가 1이 되면 C가 되며, 0 < k/B < 1여도 C가 된다는 걸 알 수 있어. 0 < k/B < 1인 k 값은 최소가 1이므로 B(C - 1) + 1가 답이 되는 거지.
즉, roundup(A/B) = C일 A의 범위는 B(C - 1) + 1 ~ BC인 거임.
저는 진정 빠가사리였네요 ㅋㅋㅋ 이해가 잘 됐어요! ㅎㅎ감사합니당