library

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub matumoto1234/library

:heavy_check_mark: math/ceil-div.hpp

Depends on

Verified with

Code

#pragma once

#include "./base.hpp"

#include <cassert>

namespace matumoto {
  constexpr ll ceil_div(ll n, ll d) {
    assert(d != 0);
    return n / d + (((n ^ d) >= 0) and (n % d));
  }
} // namespace matumoto
#line 2 "math/ceil-div.hpp"

#line 2 "math/base.hpp"

namespace matumoto {
  using namespace std;
  using ll = long long;
} // namespace matumoto
#line 4 "math/ceil-div.hpp"

#include <cassert>

namespace matumoto {
  constexpr ll ceil_div(ll n, ll d) {
    assert(d != 0);
    return n / d + (((n ^ d) >= 0) and (n % d));
  }
} // namespace matumoto
Back to top page