/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
class IntFrom0to1 {
public class InvalidValueException
extends Exception { public InvalidValueException
(String message
) { super(message);
}
}
int value;
public IntFrom0to1(int value) throws InvalidValueException {
if(value > 1)
throw new InvalidValueException("Value is out of range");
this.value = value;
}
}
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
try {
IntFrom0to1 a = new IntFrom0to1(0);
IntFrom0to1 b = new IntFrom0to1(-1);
}
e.
printStackTrace(System.
out); }
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgpjbGFzcyBJbnRGcm9tMHRvMSB7CglwdWJsaWMgY2xhc3MgSW52YWxpZFZhbHVlRXhjZXB0aW9uIGV4dGVuZHMgRXhjZXB0aW9uIHsKCQlwdWJsaWMgSW52YWxpZFZhbHVlRXhjZXB0aW9uKFN0cmluZyBtZXNzYWdlKSB7CgkJCXN1cGVyKG1lc3NhZ2UpOwoJCX0KCX0KCglpbnQgdmFsdWU7CglwdWJsaWMgSW50RnJvbTB0bzEoaW50IHZhbHVlKSB0aHJvd3MgSW52YWxpZFZhbHVlRXhjZXB0aW9uIHsKCQlpZih2YWx1ZSA+IDEpCgkJCXRocm93IG5ldyBJbnZhbGlkVmFsdWVFeGNlcHRpb24oIlZhbHVlIGlzIG91dCBvZiByYW5nZSIpOwoJCXRoaXMudmFsdWUgPSB2YWx1ZTsKCX0KfQoKLyogTmFtZSBvZiB0aGUgY2xhc3MgaGFzIHRvIGJlICJNYWluIiBvbmx5IGlmIHRoZSBjbGFzcyBpcyBwdWJsaWMuICovCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRp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