알고리즘

[알고리즘] 백준 30802 - 웰컴 키트 (C++)

blueberrysoda 2024. 9. 9. 22:42

[문제 링크] : https://www.acmicpc.net/problem/30802

#include <iostream>
using namespace std;

long long N, A, B;
long long Arr[7];
long long Ans;

int main(){
    cin >> N;
    for(int i=1; i<7; i++){
        cin >> Arr[i];
    }
    cin >> A >> B;
    for(int i=1; i<7; i++){
        if(Arr[i] % A == 0){
            Ans += (Arr[i] / A);
        }
        else{
            Ans += (Arr[i] / A + 1);
        }
    }
    cout << Ans << "\n" << N / B << " " << N % B << "\n";
    return 0;
}