import java.util.*; import java.util.zip.*; import java.util.List; import java.util.regex.*; import java.util.concurrent.*; import java.util.concurrent.atomic.*; import java.util.concurrent.locks.*; import java.util.function.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.text.*; import javax.swing.table.*; import java.io.*; import java.net.*; import java.lang.reflect.*; import java.lang.ref.*; import java.lang.management.*; import java.security.*; import java.security.spec.*; import java.awt.*; import java.awt.event.*; import java.awt.image.*; import java.awt.geom.*; import javax.imageio.*; import java.math.*; import java.time.Duration; import java.lang.invoke.VarHandle; import java.lang.invoke.MethodHandles; class main { static class Percent implements IFieldsToList{ double percent; Percent() {} Percent(double percent) { this.percent = percent;} public boolean equals(Object o) { if (!(o instanceof Percent)) return false; Percent __1 = (Percent) o; return percent == __1.percent; } public int hashCode() { int h = 985725989; h = boostHashCombine(h, _hashCode(percent)); return h; } public Object[] _fieldsToList() { return new Object[] {percent}; } static Percent fromRatio(double ratio) { return new Percent(ratio*100); } static Percent fromRatio(double x, double y) { return fromRatio(doubleRatio(x, y)); } void set(double percent) { percent = percent; } double get() { return percent; } public String toString() { return renderValue(percent) + " %"; } String renderValue(double percent) { return formatDouble(percent, 1); } final String withDecimals(int decimals){ return renderWithDecimals(decimals); } String renderWithDecimals(int decimals) { return formatDouble(percent, decimals) + " %"; } String withExactDecimals(int decimals) { return formatDoubleX(percent, decimals) + " %"; } String oneDecimal() { return withDecimals(1); } String exactlyOneDecimal() { return withExactDecimals(1); } static Percent ratio(double x, double y) { return new Percent(doubleRatio(x, y)*100); } } static int boostHashCombine(int a, int b) { return a ^ (b + 0x9e3779b9 + (a << 6) + (a >>> 2)); // OLD (changed) 2022/3/10: ret a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2)); } static int _hashCode(Object a) { return a == null ? 0 : a.hashCode(); } static double doubleRatio(double x, double y) { return y == 0 ? 0 : x/y; } static String formatDouble(double d, int digits) { String format = digits <= 0 ? "0" : "0." + rep(digits, '#'); return decimalFormatEnglish(format, d); } static String formatDouble(double d) { return str(d); } static String formatDoubleX(double d, int digits) { return formatDoubleFull(d, digits); } static String rep(int n, char c) { return repeat(c, n); } static String rep(char c, int n) { return repeat(c, n); } static List rep(A a, int n) { return repeat(a, n); } static List rep(int n, A a) { return repeat(n, a); } static String decimalFormatEnglish(String format, double d) { return decimalFormatEnglish(format).format(d); } static java.text.DecimalFormat decimalFormatEnglish(String format) { return new java.text.DecimalFormat(format, new java.text.DecimalFormatSymbols(Locale.ENGLISH)); } static String str(Object o) { return o == null ? "null" : o.toString(); } static String str(char[] c) { return new String(c); } static String str(char[] c, int offset, int count) { return new String(c, offset, count); } static String formatDoubleFull(double d, int digits) { String format = digits <= 0 ? "0" : "0." + rep(digits, '0'); return new java.text.DecimalFormat(format, new java.text.DecimalFormatSymbols(Locale.ENGLISH)).format(d); } static String repeat(char c, int n) { n = Math.max(n, 0); char[] chars = new char[n]; for (int i = 0; i < n; i++) chars[i] = c; return new String(chars); } static List repeat(A a, int n) { n = Math.max(n, 0); List l = new ArrayList(n); for (int i = 0; i < n; i++) l.add(a); return l; } static List repeat(int n, A a) { return repeat(a, n); } static interface IFieldsToList { Object[] _fieldsToList(); } }