public LIB_FactorizedNumber(LIB_FactorizedNumber x) { foreach (var item in x) { this[item.Key] = item.Value; } }
public void Div(LIB_FactorizedNumber x) { foreach (var item in x) { this[item.Key] -= item.Value; } }
public void LCM(LIB_FactorizedNumber y) { foreach (var item in y) { this[item.Key] = Max(this[item.Key], item.Value); } }
public void GCD(LIB_FactorizedNumber y) { var removeKeys = new HashSet <long>(Keys); foreach (var item in y) { if (removeKeys.Contains(item.Key)) { removeKeys.Remove(item.Key); this[item.Key] = Min(item.Value, this[item.Key]); } } foreach (var item in removeKeys) { Remove(item); } }
public bool Equals(LIB_FactorizedNumber x) => this == x;