import java.lang.*;

public class Scale {
    double min, max, lo, hi, div;

    public Scale () {}

    public Scale(double setmin, double setmax) {
	setScale(setmin, setmax);
    }
 
    public void setScale(double setmin, double setmax) {
	min=setmin;
	max=setmax;

	double range = max-min;
	
	int order = (int)Math.floor(Math.log(range) / Math.log(10));

	div = Math.pow(10.0, order);

	lo = (long) Math.floor(min/div) * div;
	hi = (long) Math.ceil(max/div) * div;
    }

}
