leetcode

Solution to some Leetcode problems written in C++
git clone git://git.dimitrijedobrota.com/leetcode.git
Log | Files | Refs | README | LICENSE

2240.cpp (242B)


      1 class Solution {
      2   public:
      3     long long waysToBuyPensPencils(int total, int cost1, int cost2) const {
      4         long long res = 0;
      5         for (; total >= 0; total -= cost1)
      6             res += 1ll + total / cost2;
      7         return res;
      8     }
      9 };