package greed.model;

/**
 * Greed is good! Cheers!
 */
public class ProblemDescription {
    private String intro;
    private String[] notes;
    private String[] constraints;

    public ProblemDescription(String intro, String[] notes, String[] constraints) {
        this.intro = intro;
        this.notes = notes;
        this.constraints = constraints;
    }

    public String getIntro() {
        return intro;
    }

    public String[] getNotes() {
        return notes;
    }

    public String[] getConstraints() {
        return constraints;
    }
}

@@ -15,16 +15,81 @@
 model;%0A%0A
+import java.util.regex.Matcher;%0Aimport java.util.regex.Pattern;%0A%0A
 /**%0A * G
@@ -235,16 +235,756 @@
 traints;
+%0A    private String mod;%0A    %0A    private String extractMod(String intro)%0A    %7B%0A        /* d, modulo 1,000,000,007.%3C/ */%0A        String pattern = %22mod(ulo)? (%5C%5Cd%5B%5C%5Cd,%5C%5C.%5D*%5C%5Cd)%22;%0A        Pattern r = Pattern.compile(pattern);%0A        Matcher m = r.matcher(intro);%0A        String res = null;%0A        // The modulo tends to be at the end of the statement. If there were%0A        // multiple modulo 1,XXX,XXX,XXX statements, it is better to get the last.%0A        while (m.find( )) %7B%0A            try %7B%0A                 res = %22%22 + %0A                        java.text.NumberFormat.%0A                         getNumberInstance(java.util.Locale.US).parse(m.group(2));%0A            %7D catch (Exception e) %7B%0A            %7D%0A        %7D%0A        return res;%0A    %7D
 %0A%0A    pu
@@ -1157,23 +1157,60 @@
 raints;%0A
+        mod = extractMod(intro);%0A
     %7D%0A
+    
 %0A
-
     publ
@@ -1390,16 +1390,81 @@
 raints;%0A
-
     %7D%0A
+    %0A    public String getMod() %7B%0A        return mod;%0A    %7D%0A    %0A
 %7D%0A

Add a Mod field to ProblemDescription.