1. 

/**
* FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10
 * Problem: 10070 Leap Year or Not Leap Year And …
* Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1011

*
 * @author Viktoriya Ryabova
* @version 1.0, 05/19/2010
*
 * Method : Ad-Hoc
* Status : Accepted
* Runtime: 0
.424
*/

 

import java.math.BigInteger;

import java.util.Scanner;

 

public class Main {

 

      public static void main(String[] args) {

 

            // TODO Auto-generated method stub

 

            BigInteger fifteen = new BigInteger("15");

 

            BigInteger  fiftyFive = new BigInteger("55");

 

            BigInteger twoThousand = new BigInteger("2000");

 

            Scanner sc = new Scanner (System.in);

 

            while (sc.hasNext()){

 

                  BigInteger year = new BigInteger(sc.nextLine());

 

// year >=2000

 

                  if (year.compareTo(twoThousand)>0 || year.equals(twoThousand)){

 

                        if (isLeapYear(year)){

 

                             System.out.println("This is leap year.");

 

                             //year%15==0

 

                             if(year.mod(fifteen).equals(BigInteger.ZERO))

 

                                   System.out.println("This is huluculu festival year.");

 

                             //year%55==0

 

                             if (year.mod(fiftyFive).equals(BigInteger.ZERO))

 

                                   System.out.println("This is bulukulu festival year.");

 

                        }

 

                        //year%15==0

 

                        else if(year.mod(fifteen).equals(BigInteger.ZERO))

 

                             System.out.println("This is huluculu festival year.");

 

                      

 

                        else System.out.println("This is an ordinary year.");

 

                  }

                  if(sc.hasNextLine())

                     System.out.println();

 

                

 

            }

 

      }

 

      // bestimmen, ob es schaltjahr ist

 

      public static boolean isLeapYear (BigInteger year) {

 

            BigInteger hundred = new BigInteger("100");

 

            BigInteger four = new BigInteger("4");

 

            BigInteger fourHundred = new BigInteger("400");

 

            if (year.mod(fourHundred).equals(BigInteger.ZERO)){

 

                  return true;

 

            }

 

            else if (year.mod(hundred).equals(BigInteger.ZERO)){

 

                  return false;

 

            }

 

            else if (year.mod(four).equals(BigInteger.ZERO)){

 

                  return true;

 

            }

 

            else return false;

 

      }

}

2.

/** * FWP, Ausgewählte Probleme aus dem ACM Programming Contest, SS10 
 * * Problem: 10070 - Leap Year or Not Leap Year and ...
 * * Link: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=12&page=show_problem&problem=1011
 * * @author Savkina Ekaterina
 * * @version 1.0, 08/06/2010
 * * Method : Ad-Hoc
 * * Status : Accepted
 * * Runtime: 0.572 */

import java.math.BigInteger;
import java.util.Scanner;

public class LeapYear {
    public static void main(String... args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextBigInteger()) {
            BigInteger year = sc.nextBigInteger();

            if ((year.mod(new BigInteger("4")).equals(new BigInteger("0"))
                    && !year.mod(new BigInteger("100")).equals(
                            new BigInteger("0")) || (year.mod(new BigInteger(
                    "400")).equals(new BigInteger("0"))))) {
                System.out.println("This is leap year.");
                if (year.mod(new BigInteger("15")).equals(new BigInteger("0")))
                    System.out.println("This is huluculu festival year.");
                if (year.mod(new BigInteger("55")).equals(new BigInteger("0")))
                    System.out.println("This is bulukulu festival year.");

            }

            else {
                if (year.mod(new BigInteger("15")).equals(new BigInteger("0")))
                    System.out.println("This is huluculu festival year.");

                else

                    System.out.println("This is an ordinary year.");
            }
            if (sc.hasNextBigInteger())
                System.out.print("\n");
        }
    }
}