fragment-header
fragment-markdown
홈
로그인
로그아웃
내 블로그
설정
로그인
백준 34306 (C++) M-Climb Road
최초 업로드: 2025-09-10 01:43:54
최근 수정 시간: 2025-09-10 01:43:54
게시자: rlatjwls3333
카테고리: 백준
조회수: 6
# [Bronze IV] M-Climb Road [문제 링크](https://www.acmicpc.net/problem/34306) ## 문제 설명 <p>Every year, new Colorado School of Mines students climb to the top of Lookout Mountain to place a rock from their hometown onto a structure of rocks in the shape of an M. For this M-Climb, students walk up the road leading up to the M while clubs and organizations line the side of the road with parked cars, cheering the students on and spraying lots of water on them.</p> <p>The upperclassmen have conspired to have a water gun placed exactly every $N$ feet, with the first being $N$ feet from the beginning of the road. The M-Climb is $W$ miles (one mile is $5280$ feet), and you will be squirted every $N$ feet, including at the $W^{\text{th}}$ mile marker (if there is a water gun there). <strong>How many times will you get squirted?</strong></p> ## 입력 <p>The input consists of two lines:</p> <p>The first line contains a single integer $1 \leq W \leq 10\,000$ representing the length of the road up to the M in miles.</p> <p>The second line contains a single integer $1 \leq N \leq W$ representing the number of feet between each Mines student with a water gun.</p> ## 출력 <p>An integer representing how many times you will get squirted with a water gun. (Remember that there is no water gun at the $0^{th}$ mile marker.)</p> ## 풀이 마일을 피트로 변환시켜 N으로 나누는 문제입니다. ``` c++ #include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int w, n; cin >> w >> n; cout << 5280*w/n; } ```