NC220437. Jam-packed
描述
输入描述
The input consists of:• A line with two integers n (1 ≤ n ≤ 1018), the number of jars that need to be packed, and k (1 ≤ k ≤ 1018), the number of jars a single box can hold.
输出描述
Output the number of jars that the least fifilled box contains.
示例1
输入:
10 3
输出:
2
示例2
输入:
16 4
输出:
4
示例3
输入:
1 2
输出:
1
C++(clang++ 11.0.1) 解法, 执行用时: 2ms, 内存消耗: 460K, 提交时间: 2023-07-14 19:28:40
#include<iostream> long long n,m; signed main(){std::cin>>n>>m&&n%m?std::cout<<n/(n/m+1):std::cout<<m;}
Python3(3.9) 解法, 执行用时: 49ms, 内存消耗: 6856K, 提交时间: 2021-04-11 22:24:43
n,k=map(int,input().split()) print(n//((n+k-1)//k))