library

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

View the Project on GitHub kk2a/library

:warning: math/max_division_times.hpp

Code

#ifndef KK2_MATH_MAX_DIVISION_TIMES_HPP
#define KK2_MATH_MAX_DIVISION_TIMES_HPP 1

namespace kk2 {

template <class T, class U> int max_division_times(T a, U b) {
    int res = 0;
    while (a % b == 0) a /= b, res++;
    return res;
}

template <class T, class U> int divide_max_times(T &a, U b) {
    int res = 0;
    while (a % b == 0) a /= b, res++;
    return res;
}

} // namespace kk2

#endif // KK2_MATH_MAX_DIVISION_TIMES_HPP
#line 1 "math/max_division_times.hpp"



namespace kk2 {

template <class T, class U> int max_division_times(T a, U b) {
    int res = 0;
    while (a % b == 0) a /= b, res++;
    return res;
}

template <class T, class U> int divide_max_times(T &a, U b) {
    int res = 0;
    while (a % b == 0) a /= b, res++;
    return res;
}

} // namespace kk2
Back to top page