Language: Java

import java.util.Scanner;
import java.math.BigDecimal;

public class Main {
	public static void main(String[] args){
		
		Scanner sc = new Scanner(System.in);

		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		BigDecimal c = sc.nextBigDecimal();
		
		BigDecimal[] d = new BigDecimal[a];
		BigDecimal[] e = new BigDecimal[b];
 
		for (int i = 0; i < a; i++) {
			d[i] = sc.nextBigDecimal();
		}
 
		for (int i = 0; i < b; i++) {
			e[i] = sc.nextIBigDecimal();
		}
		
		int n = 0;
		int m = 0;
		
		int saidaisu = 0;
		
		BigDecimal gokei = new BigDecimal("0");
		
		while (gokei.compareTo(c) <= 0) {
			if ((n < a && m < b && d[n] <= e[m] && gokei.add(new BigDecimal(d[n])).compareTo(c) <= 0)
					|| (n < a && m >= b && gokei.add(new BigDecimal(d[n])).compareTo(c) <= 0)) {

				gokei = gokei.add(new BigDecimal(d[n]));
				n++;
				saidaisu++;
				
			} else if ((n < a && m < b && d[n] >= e[m] && gokei.add(new BigDecimal(e[m])).compareTo(c) <= 0)
					|| (m < b && n >= a && gokei.add(new BigDecimal(e[m])).compareTo(c) <= 0)) {

				gokei = gokei.add(new BigDecimal(e[m]));
				m++;
				saidaisu++;
				
			} else {

				break;

			}
		}
		System.out.println(saidaisu);
	}
}

Compiler output:
Main.java:22: error: cannot find symbol
			e[i] = sc.nextIBigDecimal();
			         ^
  symbol:   method nextIBigDecimal()
  location: variable sc of type Scanner
Main.java:33: error: bad operand types for binary operator '<='
			if ((n < a && m < b && d[n] <= e[m] && gokei.add(new BigDecimal(d[n])).compareTo(c) <= 0)
			                            ^
  first type:  BigDecimal
  second type: BigDecimal
Main.java:33: error: no suitable constructor found for BigDecimal(BigDecimal)
			if ((n < a && m < b && d[n] <= e[m] && gokei.add(new BigDecimal(d[n])).compareTo(c) <= 0)
			                                                 ^
    constructor BigDecimal.BigDecimal(char[]) is not applicable
      (argument mismatch; BigDecimal cannot be converted to char[])
    constructor BigDecimal.BigDecimal(String) is not applicable
      (argument mismatch; BigDecimal cannot be converted to String)
    constructor BigDecimal.BigDecimal(double) is not applicable
      (argument mismatch; BigDecimal cannot be converted to double)
    constructor BigDecimal.BigDecimal(BigInteger) is not applicable
      (argument mismatch; BigDecimal cannot be converted to BigInteger)
    constructor BigDecimal.BigDecimal(int) is not applicable
      (argument mismatch; BigDecimal cannot be converted to int)
    constructor BigDecimal.BigDecimal(long) is not applicable
      (argument mismatch; BigDecimal cannot be converted to long)
Main.java:34: error: no suitable constructor found for BigDecimal(BigDecimal)
					|| (n < a && m >= b && gokei.add(new BigDecimal(d[n])).compareTo(c) <= 0)) {
					                                 ^
    constructor BigDecimal.BigDecimal(char[]) is not applicable
      (argument mismatch; BigDecimal cannot be converted to char[])
    constructor BigDecimal.BigDecimal(String) is not applicable
      (argument mismatch; BigDecimal cannot be converted to String)
    constructor BigDecimal.BigDecimal(double) is not applicable
      (argument mismatch; BigDecimal cannot be converted to double)
    constructor BigDecimal.BigDecimal(BigInteger) is not applicable
      (argument mismatch; BigDecimal cannot be converted to BigInteger)
    constructor BigDecimal.BigDecimal(int) is not applicable
      (argument mismatch; BigDecimal cannot be converted to int)
    constructor BigDecimal.BigDecimal(long) is not applicable
      (argument mismatch; BigDecimal cannot be converted to long)
Main.java:36: error: no suitable constructor found for BigDecimal(BigDecimal)
				gokei = gokei.add(new BigDecimal(d[n]));
				                  ^
    constructor BigDecimal.BigDecimal(char[]) is not applicable
      (argument mismatch; BigDecimal cannot be converted to char[])
    constructor BigDecimal.BigDecimal(String) is not applicable
      (argument mismatch; BigDecimal cannot be converted to String)
    constructor BigDecimal.BigDecimal(double) is not applicable
      (argument mismatch; BigDecimal cannot be converted to double)
    constructor BigDecimal.BigDecimal(BigInteger) is not applicable
      (argument mismatch; BigDecimal cannot be converted to BigInteger)
    constructor BigDecimal.BigDecimal(int) is not applicable
      (argument mismatch; BigDecimal cannot be converted to int)
    constructor BigDecimal.BigDecimal(long) is not applicable
      (argument mismatch; BigDecimal cannot be converted to long)
Main.java:40: error: bad operand types for binary operator '>='
			} else if ((n < a && m < b && d[n] >= e[m] && gokei.add(new BigDecimal(e[m])).compareTo(c) <= 0)
			                                   ^
  first type:  BigDecimal
  second type: BigDecimal
Main.java:40: error: no suitable constructor found for BigDecimal(BigDecimal)
			} else if ((n < a && m < b && d[n] >= e[m] && gokei.add(new BigDecimal(e[m])).compareTo(c) <= 0)
			                                                        ^
    constructor BigDecimal.BigDecimal(char[]) is not applicable
      (argument mismatch; BigDecimal cannot be converted to char[])
    constructor BigDecimal.BigDecimal(String) is not applicable
      (argument mismatch; BigDecimal cannot be converted to String)
    constructor BigDecimal.BigDecimal(double) is not applicable
      (argument mismatch; BigDecimal cannot be converted to double)
    constructor BigDecimal.BigDecimal(BigInteger) is not applicable
      (argument mismatch; BigDecimal cannot be converted to BigInteger)
    constructor BigDecimal.BigDecimal(int) is not applicable
      (argument mismatch; BigDecimal cannot be converted to int)
    constructor BigDecimal.BigDecimal(long) is not applicable
      (argument mismatch; BigDecimal cannot be converted to long)
Main.java:41: error: no suitable constructor found for BigDecimal(BigDecimal)
					|| (m < b && n >= a && gokei.add(new BigDecimal(e[m])).compareTo(c) <= 0)) {
					                                 ^
    constructor BigDecimal.BigDecimal(char[]) is not applicable
      (argument mismatch; BigDecimal cannot be converted to char[])
    constructor BigDecimal.BigDecimal(String) is not applicable
      (argument mismatch; BigDecimal cannot be converted to String)
    constructor BigDecimal.BigDecimal(double) is not applicable
      (argument mismatch; BigDecimal cannot be converted to double)
    constructor BigDecimal.BigDecimal(BigInteger) is not applicable
      (argument mismatch; BigDecimal cannot be converted to BigInteger)
    constructor BigDecimal.BigDecimal(int) is not applicable
      (argument mismatch; BigDecimal cannot be converted to int)
    constructor BigDecimal.BigDecimal(long) is not applicable
      (argument mismatch; BigDecimal cannot be converted to long)
Main.java:43: error: no suitable constructor found for BigDecimal(BigDecimal)
				gokei = gokei.add(new BigDecimal(e[m]));
				                  ^
    constructor BigDecimal.BigDecimal(char[]) is not applicable
      (argument mismatch; BigDecimal cannot be converted to char[])
    constructor BigDecimal.BigDecimal(String) is not applicable
      (argument mismatch; BigDecimal cannot be converted to String)
    constructor BigDecimal.BigDecimal(double) is not applicable
      (argument mismatch; BigDecimal cannot be converted to double)
    constructor BigDecimal.BigDecimal(BigInteger) is not applicable
      (argument mismatch; BigDecimal cannot be converted to BigInteger)
    constructor BigDecimal.BigDecimal(int) is not applicable
      (argument mismatch; BigDecimal cannot be converted to int)
    constructor BigDecimal.BigDecimal(long) is not applicable
      (argument mismatch; BigDecimal cannot be converted to long)
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
9 errors