You are given two arrays A and B, each of size n. The error, E, between these two arrays is defined <image>. You have to perform exactly k1 operations on array A and exactly k2 operations on array B. In one operation, you have to choose one element of the array and increase or decrease it by 1.

Output the minimum possible value of error after k1 operations on array A and k2 operations on array B have been performed.

Input

The first line contains three space-separated integers n (1 ≤ n ≤ 103), k1 and k2 (0 ≤ k1 + k2 ≤ 103, k1 and k2 are non-negative) — size of arrays and number of operations to perform on A and B respectively.

Second line contains n space separated integers a1, a2, ..., an ( - 106 ≤ ai ≤ 106) — array A.

Third line contains n space separated integers b1, b2, ..., bn ( - 106 ≤ bi ≤ 106)— array B.

Output

Output a single integer — the minimum possible value of <image> after doing exactly k1 operations on array A and exactly k2 operations on array B.

Examples

Input

2 0 0
1 2
2 3


Output

2

Input

2 1 0
1 2
2 2


Output

0

Input

2 5 7
3 4
14 4


Output

1

Note

In the first sample case, we cannot perform any operations on A or B. Therefore the minimum possible error E = (1 - 2)2 + (2 - 3)2 = 2. 

In the second sample case, we are required to perform exactly one operation on A. In order to minimize error, we increment the first element of A by 1. Now, A = [2, 2]. The error is now E = (2 - 2)2 + (2 - 2)2 = 0. This is the minimum possible error obtainable.

In the third sample case, we can increase the first element of A to 8, using the all of the 5 moves available to us. Also, the first element of B can be reduced to 8 using the 6 of the 7 available moves. Now A = [8, 4] and B = [8, 4]. The error is now E = (8 - 8)2 + (4 - 4)2 = 0, but we are still left with 1 move for array B. Increasing the second element of B to 5 using the left move, we get B = [8, 5] and E = (8 - 8)2 + (4 - 5)2 = 1.


import javafx.util.Pair;

import java.io.*;
//import java.lang.reflect.Array;

import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;


public class citylights {
    public static int[] arr;
    public static ArrayList<Integer> p;
    public static int[] val;
    public static long[] facto;
    public static long mod = 1000000007;
    public static long[] fillme;
    public static int ans = 0;
    public static int n, k;
    public static int [][]a;
    public static int []cnt=new int[27];
    static InputReader in;
    static PrintWriter out;
    public static HashSet<Long> hs=new HashSet<>();
    public static ArrayList<Integer> ar[];
    public static long x,y;
    public static long MOD= (long) (1e9+7);
    public static boolean []v;
    public static int []cal = {31,28,31,30,31,30,31,31,30,31,30,31};

//--------------------------------------My Code--------------------------------------------

    public static void main(String[] args) throws IOException {
        //arr = new int[1000001];
        //  p = new ArrayList<>();
        //  val = new int[1000001];
        // facto = new long[10000007];
        //tt=new int[100];
        //sieve();
        //  fact();
        //  BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

        InputReader in=new InputReader(System.in);
        PrintWriter out=new PrintWriter(System.out);

        int n = in.nextInt();
        int k1 = in.nextInt();
        int k2 = in.nextInt();
        long []a = new long[n];
        long []b = new long[n];
        for(int i = 0;i<n;i++)
        {
            a[i] = in.nextLong();
        }
        for (int j = 0;j<n;j++)
        {
            b[j] = in.nextLong();
        }
        long []c = new long[n];
        for (int i = 0;i<n;i++)
        {
            c[i] = Math.abs(a[i] - b[i]);
        }
        PriorityQueue<Pair<Long,Long>> pp = new PriorityQueue<>(new Comparator<Pair<Long, Long>>() {
            @Override
            public int compare(Pair<Long, Long> o1, Pair<Long, Long> o2) {
                if(o1.getKey()>o2.getKey())
                    return -1;
                else if(o1.getKey()<o2.getKey())
                    return 1;
                return 0;
            }
        });

        for (int i = 0;i<n;i++)
        {
            Pair<Long,Long> kola = new Pair<>(c[i],(long)i);
            pp.add(kola);
        }
        Pair<Long,Long> pola;
        while (k1!=0)
        {
            pola = pp.poll();
            long x = pola.getKey();
            long y = pola.getValue();
            if(x>0)
            {
               x--;
            }else
            {
                x++;
            }
            c[(int)y] = x;
            k1--;
            pola = new Pair<>(x,y);
            pp.add(pola);
        }

        while (k2!=0)
        {
            pola = pp.poll();
            long x = pola.getKey();
            long y = pola.getValue();
            if(x>0)
            {
                x--;
            }else
            {
                x++;
            }
            k2--;
            c[(int)y] = x;
            pola = new Pair<>(x,y);
            pp.add(pola);

        }
        long sum = 0;
        long mul = 0;
        for (int i = 0 ; i<n;i++)
        {
            mul = c[i]*c[i];
            sum+=mul;
        }
        out.println(sum);

        out.close();
    }
    //-------------------------------------------Code ends-------------------------------
static class people{
        String name;
        int region;
        int point;

        public people(String name, int region, int point) {
            this.name = name;
            this.region = region;
            this.point = point;
        }
    }
 static long getFactorial(long number) {
        long factorial = 1;
        for (long i = 1; i <= number; ++i) {
            factorial *= i;
        }
        return factorial;
    }
    public static void primeFactors(long n)
    {
        // Print the number of 2s that divide n
        while (n%2==0)
        {
           hs.add((long) 2);
            n /= 2;
        }
        long k= (long) Math.sqrt(n);
        for (int i = 3; i <= k; i+= 2)
        {
            while (n%i == 0)
            {
                hs.add((long) i);
                n /= i;
            }
        }
        if (n > 2)
            hs.add(n);
    }

    public static long bsearchg(int[] a, int t) {
        long ans = 0;
        int low = 0;
        int high = a.length - 1;
        while (low <= high) {
            int mid = (low + high) / 2;
            if (a[mid] <= t) {
                ans = mid;

                low = mid + 1;
            } else
                high = mid - 1;


        }
        return ans;

    }


    private static long fib(long n) {
        if (n == 1) return y;
        if (n == 0) return x;
        long[][] F = new long[][]{{1, -1}, {1, 0}};
        matPow(F, n);
        return F[0][0];
        //return 0l;
    }

    private static void matPow(long[][] F, long n) {
        if (n == 0 || n == 1)
            return;
        long M[][] = new long[][]{{1, -1}, {1, 0}};

        matPow(F, n / 2);
        matrixMult(F, F);

        if (n % 2 != 0)
            matrixMult(F, M);
    }

    public static long MOD(long x,long y)
    {
        long xk=x;
        long yk=y;
        if(xk<0)
        {
           xk+=mod;
        }if(yk<0)
        {
            yk+=mod;
        }
        return (xk+yk)%mod;


    }
    private static void matrixMult(long A[][], long M[][]) {
        long a = MOD((A[0][0] * M[0][0]) %mod, (A[0][1] * M[1][0])%mod) % mod;
        long b = MOD((A[0][0] * M[0][1])%mod , (A[0][1] * M[1][1])%mod) % mod;
        long c = MOD((A[1][0] * M[0][0])%mod, (A[1][1] * M[1][0])%mod) % mod;
        long d = MOD((A[1][0] * M[0][1])%mod, (A[1][1] * M[1][1])%mod)% mod;

        A[0][0] = a;
        A[0][1] = b;
        A[1][0] = c;
        A[1][1] = d;
    }

    private static long lcm(long a, long b) {
        return (long) ((a * b) / euclgcd(a, b));
    }

    public static int[] rotate(int[] order, int by) {
        int length = order.length;
        int[] a = new int[length];
        for (int i = 0; i < length; i++) {
            a[(i + by) % length] = order[i];

        }
        return a;


    }

    public static long modinv(long x, long m) {
        return powmod(x, m - 2, m);

    }

    public static long eulertoitent(long n) {
        long res = n;
        for (int i = 2; i * i <= n; i++)
            if (n % i == 0) {
                while (n % i == 0)
                    n /= i;
                res -= res / i;
            }
        if (n > 1)
            res -= res / n;
        return res;


    }

    //calculate factorial till modulas
    public static void fact() {
        facto[0] = 1;
        for (int i = 1; i <= mod; i++) {
            facto[i] = (i * facto[i - 1]) % mod;
        }


    }

    public static void sieve() {
        arr[0] = 1;
        arr[1] = 1;

        for (int i = 2; i * i < 1000001; i++) {
            if (arr[i] == 0) {

                for (int j = i * i; j < 1000001; j += i) {
                    arr[j] = 1;
                }
            }
        }
        for (int i = 2; i < 1000001; i++) {
            if (arr[i] == 0)
                p.add(i);
        }
    }

    public static boolean isPrime(int n) {
        // Corner cases
        if (n <= 1) return false;
        if (n <= 3) return true;

        // This is checked so that we can skip
        // middle five numbers in below loop
        if (n % 2 == 0 || n % 3 == 0) return false;

        for (int i = 5; i * i <= n; i = i + 6)
            if (n % i == 0 || n % (i + 2) == 0)
                return false;

        return true;
    }

    public static long euclgcd(long a, long b) {
        if (b == 0)
            return a;
        else
            return euclgcd(b, a % b);

    }

    public static long powmod(long x, long n, long m) {
        long result = 1L;
        while (n > 0) {
            if (n % 2 == 1)
                result = (result * x) % m;
            x = (x * x) % m;
            n = n / 2;
        }

        return result;
    }


    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }


}