Flatter Land

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

요약
일직선 위에 x피트 간격으로 서 있는 n명 중 가장 멀리 떨어진 두 사람 사이의 거리를 구한다.
난이도

쉬움10점 중 1점

유형
수학, 구현
정답자
아직 제출이 없습니다

문제

You may have heard of Flat Land, the 22D place, but have you heard of Flatter Land, the 11D place? In Flatter Land, a disease has begun ravaging the cities. To keep the citizens of Flatter Land safe, their experts recommend that they maintain at least xx feet of distance between people. If nn Flatter Land citizens are standing as close to each other as they safely can, what's the longest distance between any two of them? You can assume that the people themselves take up no space.

입력

The first line tells you the number of people (2≤n≤1002 \leq n \leq 100) and the second tells you the recommended distance between people in feet (3≤x≤1003 \leq x \leq 100).

출력

You should print the farthest distance between any two people in the group assuming that the distance from one person to the next is exactly the recommended distance. You may also assume that people take up no space.

예제2

  1. 예제 1

    입력
    3
    6
    
    예상 출력
    12
    
  2. 예제 2

    입력
    5
    10
    
    예상 출력
    40