//#define EXTENDSTACKSIZE

using System;
 using System.Collections.Generic;
 using System.Globalization;
using System.IO;
using System.Linq;
 using System.Text;
 using System.Threading;

         namespace CF
{
    internal class Program
    {
        private const int stackSize = 64 * 1024 * 1024;

        private static void Run()
        {
            using (var sr = new InputReader(Console.In))
//            using (var sr = new InputReader(new StreamReader("input.txt")))
            using (var sw = Console.Out)
//            using (var sw = new StreamWriter("output.txt"))
            using (var task = new Task(sr, sw)) {
                task.Solve();
//                Console.ReadKey();
            }
        }

        private static void Main(string[] args)
        {
#if EXTENDSTACKSIZE
            var threadStart = new ThreadStart(Run);
            var thread = new Thread(threadStart, stackSize);
            thread.Start();
            thread.Join();
#else
            Run();
#endif
        }
    }

    internal class Task : IDisposable
    {
        private readonly InputReader sr;
        private readonly TextWriter sw;
        private bool isDispose;

        public Task(InputReader sr, TextWriter sw)
        {
            this.sr = sr;
            this.sw = sw;
        }

        public void Solve()
        {
            var tests = sr.NextInt32();
            var answ = new StringBuilder();
            for (var t = 0; t < tests; t++)
            {
                var n = sr.NextInt32();
                var k = sr.NextInt32();
                var items = sr.ReadArrayOfInt64();
                var odd = items.Count(i => i % 2 == 1);
                if (odd < k)
                {
                    answ.AppendLine("NO");
                    continue;
                }

                if (k % 2 != odd % 2)
                {
                    answ.AppendLine("NO");
                    continue;
                }

                answ.AppendLine("YES");
                for (var i = 0; i < n; i++)
                {
                    if (items[i] % 2 == 1)
                    {
                        if (k == 1)
                        {
                            answ.Append(n.ToString());
                            break;
                        }
                        var j = i + 1;
                        for (; j < n; j++)
                        {
                            if (items[j] % 2 == 1)
                            {
                                break;
                            }
                        }

                        i = j - 1;
                        answ.Append((i + 1) + " ");
                        k--;
                    }
                }

                answ.AppendLine();
            }

            sw.Write(answ);
        }

        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }

        private void Dispose(bool disposing)
        {
            if (!isDispose) {
                if (disposing) {
                    if(sr != null)
                        sr.Dispose();

                    if(sw != null)
                        sw.Dispose();
                }

                isDispose = true;
            }
        }
    }
}

internal class InputReader : IDisposable
{
    private bool isDispose;
    private readonly TextReader sr;
    private string[] buffer;
    private int seek;

    public InputReader(TextReader stream)
    {
        sr = stream;
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public string NextString()
    {
        var result = sr.ReadLine();
        return result;
    }

    public int NextInt32()
    {
        return Int32.Parse(ReadNextToken());
    }

    private string ReadNextToken()
    {
        if (buffer == null || seek == buffer.Length) {
            seek = 0;
            buffer = NextSplitStrings();
        }

        return buffer[seek++];
    }

    public long NextInt64()
    {
        return Int64.Parse(ReadNextToken());
    }

    public int[] ReadArrayOfInt32()
    {
        return ReadArray(Int32.Parse);
    }

    public long[] ReadArrayOfInt64()
    {
        return ReadArray(Int64.Parse);
    }

    public string[] NextSplitStrings()
    {
        return NextString()
            .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
    {
        return NextSplitStrings()
            .Select(s => func(s, CultureInfo.InvariantCulture))
            .ToArray();
    }

    public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
    {
        return
            str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
    }

    protected void Dispose(bool dispose)
    {
        if (!isDispose)
        {
            if (dispose)
                sr.Close();

            isDispose = true;
        }
    }

    ~InputReader()
    {
        Dispose(false);
    }
}


/*
csc -debug B.cs && mono --debug B.exe <<< "3
5 3
7 18 3 14 1
5 4
1 2 3 4 5
6 2
1 2 8 4 10 2"
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Reflection;

public class HelloWorld {
    public static void SolveCodeForces() {
        var Q = cin.NextInt();
        while (Q-->0) {
            var n = cin.NextInt();
            var k = cin.NextInt();
            var A = cin.LongArray();
            var ans = new List<int>();
            for (var i = 0; i < n; i++) {
                if (A[i] % 2 == 1) {
                    ans.Add(i + 1);
                }
            }
            while (ans.Count > k && ans.Count >= 3) {
                var r = ans[ans.Count - 1];
                ans.RemoveAt(ans.Count - 1);
                ans.RemoveAt(ans.Count - 1);
                ans.RemoveAt(ans.Count - 1);
                ans.Add(r);
            }

            if (ans.Count != k) {
                cout.AppendLine("NO");
            }
            else {
                ans[ans.Count - 1] = n;
                cout.AppendLine("YES");
                cout.AppendLine(ans.Join(" "));
            }
        }
    }

    static Scanner cin = new Scanner();
    static StringBuilder cout = new StringBuilder();

    static public void Main () {
        SolveCodeForces();
        // IncreaseStack(SolveCodeForces);
        System.Console.Write(cout.ToString());
    }

    public static void IncreaseStack(ThreadStart action, int stackSize = 128000000)
    {
        var thread = new Thread(action, stackSize);
        thread.Start();
        thread.Join();
    }
}

public static class Helpers {
    public static string Join<T>(this IEnumerable<T> arr, string sep = " ") {
        return string.Join(sep, arr);
    }

    public static void Swap<T>(ref T a, ref T b) {
        var tmp = a;
        a = b;
        b = tmp;
    }

    public static T[] CreateArray<T>(int length, Func<int, T> itemCreate) {
        var result = new T[length];
        for (var i = 0; i < result.Length; i++)
            result[i] = itemCreate(i);
        return result;
    }
}

public class Scanner
{
    private string[] line = new string[0];
    private int index = 0;

    public string Next() {
        if (line.Length <= index) {
            line = Console.ReadLine().Split(' ');
            index = 0;
        }
        var res = line[index];
        index++;
        return res;
    }

    public int NextInt() {
        return int.Parse(Next());
    }

    public long NextLong() {
        return long.Parse(Next());
    }

    public ulong NextUlong() {
        return ulong.Parse(Next());
    }

    public string[] Array() {
        line = Console.ReadLine().Split(' ');
        index = line.Length;
        return line;
    }

    public int[] IntArray(int emptyPrefixLen = 0) {
        var array = Array();
        var result = new int[emptyPrefixLen + array.Length];
        for (int i = 0; i < array.Length; i++)
            result[emptyPrefixLen + i] = int.Parse(array[i]);
        return result;
    }

    public long[] LongArray() {
        var array = Array();
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = long.Parse(array[i]);
        return result;
    }

    public ulong[] UlongArray() {
        var array = Array();
        var result = new ulong[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = ulong.Parse(array[i]);
        return result;
    }
}


/*
csc -debug B.cs && mono --debug B.exe <<< "3
5 3
7 18 3 14 1
5 4
1 2 3 4 5
6 2
1 2 8 4 10 2"
*/

using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Reflection;

public class HelloWorld {
    public static void SolveCodeForces() {
        var Q = cin.NextInt();
        while (Q-->0) {
            var n = cin.NextInt();
            var k = cin.NextInt();
            var A = cin.LongArray();
            var ans = new List<int>();
            for (var i = 0; i < n; i++) {
                if (A[i] % 2 == 1) {
                    ans.Add(i + 1);
                }
            }
            while (ans.Count > k && ans.Count >= 3) {
                var r = ans[ans.Count - 1];
                ans.RemoveAt(ans.Count - 1);
                ans.RemoveAt(ans.Count - 1);
                ans.RemoveAt(ans.Count - 1);
                ans.Add(r);
            }

            if (ans.Count != k) {
                cout.AppendLine("NO");
            }
            else {
                cout.AppendLine("YES");
                cout.AppendLine(ans.Join(" "));
            }
        }
    }

    static Scanner cin = new Scanner();
    static StringBuilder cout = new StringBuilder();

    static public void Main () {
        SolveCodeForces();
        // IncreaseStack(SolveCodeForces);
        System.Console.Write(cout.ToString());
    }

    public static void IncreaseStack(ThreadStart action, int stackSize = 128000000)
    {
        var thread = new Thread(action, stackSize);
        thread.Start();
        thread.Join();
    }
}

public static class Helpers {
    public static string Join<T>(this IEnumerable<T> arr, string sep = " ") {
        return string.Join(sep, arr);
    }

    public static void Swap<T>(ref T a, ref T b) {
        var tmp = a;
        a = b;
        b = tmp;
    }

    public static T[] CreateArray<T>(int length, Func<int, T> itemCreate) {
        var result = new T[length];
        for (var i = 0; i < result.Length; i++)
            result[i] = itemCreate(i);
        return result;
    }
}

public class Scanner
{
    private string[] line = new string[0];
    private int index = 0;

    public string Next() {
        if (line.Length <= index) {
            line = Console.ReadLine().Split(' ');
            index = 0;
        }
        var res = line[index];
        index++;
        return res;
    }

    public int NextInt() {
        return int.Parse(Next());
    }

    public long NextLong() {
        return long.Parse(Next());
    }

    public ulong NextUlong() {
        return ulong.Parse(Next());
    }

    public string[] Array() {
        line = Console.ReadLine().Split(' ');
        index = line.Length;
        return line;
    }

    public int[] IntArray(int emptyPrefixLen = 0) {
        var array = Array();
        var result = new int[emptyPrefixLen + array.Length];
        for (int i = 0; i < array.Length; i++)
            result[emptyPrefixLen + i] = int.Parse(array[i]);
        return result;
    }

    public long[] LongArray() {
        var array = Array();
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = long.Parse(array[i]);
        return result;
    }

    public ulong[] UlongArray() {
        var array = Array();
        var result = new ulong[array.Length];
        for (int i = 0; i < array.Length; i++)
            result[i] = ulong.Parse(array[i]);
        return result;
    }
}


/* Date: 25.07.2019  *  Time: 21:45 */
//
// https://docs.microsoft.com/en-us/dotnet/api/system.tuple-8?redirectedfrom=MSDN&view=netframework-4.7.2
//

/*
�	fflush(stdout) � ����� C++;
�	System.out.flush() � Java;
�	stdout.flush() � Python;
�	flush(output) � Pascal;

*/

using System;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

class Example
{
	public static void Swap (ref int a, ref int b)
	{
		int c = a; a = b; b = c;
	}
	public static void Main (string[] args)
	{
# if ( ! ONLINE_JUDGE )
		StreamReader sr = new StreamReader ("C:\\TRR\\2019\\Task\\07 Codeforces\\040\\B.TXT");
		StreamWriter sw = new StreamWriter ("C:\\TRR\\2019\\Task\\07 Codeforces\\040\\OUTPUT.OUT");
# endif

		NumberFormatInfo nfi = NumberFormatInfo.InvariantInfo;

		int q;
# if ( ONLINE_JUDGE )
		q = int.Parse (Console.ReadLine ());
# else
		q = int.Parse (sr.ReadLine ());
		sw.WriteLine ("*** test = " + q);
# endif

		for ( int __q=0; __q < q; __q++ )
		{
			string s;
# if ( ONLINE_JUDGE )
			s = Console.ReadLine ();
# else
			s = sr.ReadLine ();
# endif

			int n, k;
			{
				string [] ss = s.Split (' ');
				n = int.Parse (ss [0]);
				k = int.Parse (ss [1]);
			}

# if ( ONLINE_JUDGE )
			s = Console.ReadLine ();
# else
			s = sr.ReadLine ();
# endif

			int [] a = new int [n];
			int [] b = new int [k];
			{
				string [] ss = s.Split (' ');
				for ( int i=0; i < n; i++ )
					a [i] = int.Parse (ss [i]);
			}

# if ( ! ONLINE_JUDGE )
			sw.WriteLine ("*** n = " + n + "   k = " + k);
			sw.Write ("***");
			for ( int i=0; i < n; i++ )
				sw.Write (" " + a [i]);
			sw.WriteLine ();
# endif

			bool ok = true;
			int m = 0, sum = 0;
			for ( int i=0; i < n; i++ )
			{
				if ( a [i] % 2 != 0 && m < k )
				{
					b [m++] = i+1;
					sum = 0;
				}
				else
					sum += a [i];
			}

			if	( m == k && sum % 2 == 0 )
				b [k-1] = n;
			else
				ok = false;

# if ( ! ONLINE_JUDGE )
			sw.WriteLine ("*** sum = " + sum);
# endif

# if ( ONLINE_JUDGE )
			if ( ! ok )
				Console.WriteLine ("NO");
			else
			{
				Console.WriteLine ("YES");
				for ( int i=0; i < k; i++ )
					Console.Write (b [i] + " ");
				Console.WriteLine ();
			}
# else
			if ( ! ok )
				sw.WriteLine ("NO");
			else
			{
				sw.WriteLine ("YES");
				for ( int i=0; i < k; i++ )
					sw.Write (b [i] + " ");
				sw.WriteLine ();
			}
# endif
		}

# if ( ! ONLINE_JUDGE )
		sw.Close ();
# endif

	}
}


// ReSharper disable RedundantUsingDirective
// ReSharper disable JoinDeclarationAndInitializer
// ReSharper disable MemberCanBeMadeStatic.Local
// ReSharper disable PossibleNullReferenceException
// ReSharper disable ArrangeTypeMemberModifiers
// ReSharper disable SuggestVarOrType_BuiltInTypes
// ReSharper disable SuggestVarOrType_Elsewhere
// ReSharper disable InvertIf
// ReSharper disable InconsistentNaming
// ReSharper disable ConvertIfStatementToSwitchStatement
// ReSharper disable UseObjectOrCollectionInitializer
// ReSharper disable TailRecursiveCall
// ReSharper disable RedundantUsingDirective
// ReSharper disable InlineOutVariableDeclaration
// ReSharper disable FunctionRecursiveOnAllPaths
// ReSharper disable UnusedMember.Global
// ReSharper disable MemberCanBeMadeStatic.Global
// ReSharper disable UnusedMember.Local
// ReSharper disable NonReadonlyMemberInGetHashCode
#pragma warning disable
using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Numerics;
using static System.Math;
using static AtCoder.Input;
using static AtCoder.Methods;
using MethodImpl = System.Runtime.CompilerServices.MethodImplAttribute;
using MethodImplOptions = System.Runtime.CompilerServices.MethodImplOptions;

#if !LOCAL
namespace Library { }
#endif
namespace AtCoder
{
    #region Templete

    public static class Methods
    {
        public static readonly int[] dx = {-1, 0, 0, 1};

        public static readonly int[] dy = {0, 1, -1, 0};

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static void Assert(bool b, string message = null)
        {
            if (!b) throw new Exception(message ?? "Assert failed.");
        }

        /*
        public static Comparison<T> greater<T>()
            where T : IComparable<T>
            => (a, b) => b.CompareTo(a);
        */
        public static void Print<T>(T t) => Console.WriteLine(t);

        public static void PrintBool(bool val, string yes = "Yes", string no = "No")
            => Console.WriteLine(val ? yes : no);

        public static void PrintYn(bool val) => PrintBool(val);
        public static void PrintYN(bool val) => PrintBool(val, "YES", "NO");
        public static void PrintPossible(bool val) => PrintBool(val, "Possible", "Impossible");
        public static void PrintYay(bool val) => PrintBool(val, "Yay!", ":(");

        public static void PrintDebug(params object[] args)
            => Console.Error.WriteLine(string.Join(" ", args));

        public static string Join<T>(this IEnumerable<T> source, string s) => string.Join(s, source);
        public static string Join<T>(this IEnumerable<T> source, char c) => string.Join(c.ToString(), source);

        ///
        /// <see cref="Pair{T1, T2}"/> クラスのインスタンスを作成します。
        ///
        /// <typeparam name="T1">firstの型</typeparam>
        /// <typeparam name="T2">secondの型</typeparam>
        /// <param name="first">firstの値</param>
        /// <param name="second">secondの値</param>
        /// <returns>作成した<see cref="Pair{T1, T2}"/> クラスのインスタンス</returns>
        public static Pair<T1, T2> make_pair<T1, T2>(T1 first, T2 second)
            where T1 : IComparable<T1>
            where T2 : IComparable<T2>
            => new Pair<T1, T2>(first, second);

        /// aとbをスワップします。に
        public static void Swap<T>(ref T a, ref T b) where T : struct
        {
            var tmp = b;
            b = a;
            a = tmp;
        }

        /// aとbの最大公約数を求めます。
        /// <returns>aとbの最大公約数</returns>
        public static long Gcd(long a, long b)
        {
            if (a < b) Swap(ref a, ref b);
            return a % b == 0 ? b : Gcd(b, a % b);
        }

        /// aとbの最小公倍数を求めます。
        /// <returns>aとbの最小公倍数</returns>
        public static long Lcm(long a, long b) => a / Gcd(a, b) * b;

        ///
        /// 指定した数値が素数であるかを判定します。
        ///
        /// <remarks>計算量 (sqrt(value)) </remarks>
        /// <param name="value">判定する数値</param>
        /// <returns>value が素数であるか</returns>
        public static bool IsPrime(long value)
        {
            if (value <= 1) return false;
            for (long i = 2; i * i <= value; i++)
                if (value % i == 0)
                    return false;
            return true;
        }

        ///
        /// <see cref="a"/> ^ <see cref="b"/> (mod <see cref="p"/>) を求める
        ///
        /// <returns><see cref="a"/> ^ <see cref="b"/> (mod <see cref="p"/>) の値</returns>
        public static long PowMod(long a, long b, long p)
        {
            long res = 1;
            while (b > 0)
            {
                if (b % 2 != 0) res = res * a % p;
                a = a * a % p;
                b >>= 1;
            }

            return res;
        }

        ///
        /// mod pにおけるaの逆元を求めます。
        ///
        /// <param name="a"></param>
        /// <param name="mod">法</param>
        /// <returns></returns>
        public static long ModInv(long a, long p)
            => PowMod(a, p - 2, p);

        public static int DivCeil(int left, int right)
            => left / right + (left % right == 0 ? 0 : 1);

        public static long DivCeil(long left, long right)
            => left / right + (left % right == 0L ? 0L : 1L);

        ///
        /// src の順列を求めます。
        ///
        /// <typeparam name="T">型</typeparam>
        /// <param name="src">順列を求める配列</param>
        /// <returns>src の順列</returns>
        public static IEnumerable<T[]> Permutations<T>(IEnumerable<T> src)
        {
            var ret = new List<T[]>();
            Search(ret, new Stack<T>(), src.ToArray());
            return ret;
        }

        private static void Search<T>(ICollection<T[]> perms, Stack<T> stack, T[] a)
        {
            int N = a.Length;
            if (N == 0) perms.Add(stack.Reverse().ToArray());
            else
            {
                var b = new T[N - 1];
                Array.Copy(a, 1, b, 0, N - 1);
                for (int i = 0; i < a.Length; ++i)
                {
                    stack.Push(a[i]);
                    Search(perms, stack, b);
                    if (i < b.Length) b[i] = a[i];
                    stack.Pop();
                }
            }
        }

        ///
        /// 指定した条件を満たす最小の数値を返します。
        ///
        /// <param name="low">検索する数値の最小値</param>
        /// <param name="high">検索する数値の最大値</param>
        /// <param name="expression">条件</param>
        /// <returns>条件を満たす最小の数値</returns>
        public static int BinarySearch(int low, int high, Func<int, bool> expression)
        {
            while (low < high)
            {
                int middle = (high - low) / 2 + low;
                if (expression(middle))
                    high = middle;
                else
                    low = middle + 1;
            }

            return high;
        }

        ///
        /// 指定した値以上の先頭のインデクスを返します。
        ///
        /// <typeparam name="T">比較する値の型</typeparam>
        /// <param name="arr">対象の配列（※ソート済みであること）</param>
        /// <param name="start">開始インデクス [inclusive]</param>
        /// <param name="end">終了インデクス [exclusive]</param>
        /// <param name="value">検索する値</param>
        /// <param name="comparer">比較関数(インターフェイス)</param>
        /// <returns>指定した値以上の先頭のインデクス</returns>
        public static int LowerBound<T>(T[] arr, int start, int end, T value, IComparer<T> comparer)
        {
            int low = start;
            int high = end;
            while (low < high)
            {
                var mid = ((high - low) >> 1) + low;
                if (comparer.Compare(arr[mid], value) < 0)
                    low = mid + 1;
                else
                    high = mid;
            }

            return low;
        }

        ///
        /// 指定した値以上の先頭のインデクスを返します。
        ///
        /// <typeparam name="T">比較する値の型</typeparam>
        /// <param name="arr">対象の配列（※ソート済みであること）</param>
        /// <param name="value">検索する値</param>
        /// <returns>指定した値以上の先頭のインデクス</returns>
        public static int LowerBound<T>(T[] arr, T value) where T : IComparable
        {
            return LowerBound(arr, 0, arr.Length, value, Comparer<T>.Default);
        }

        ///
        /// 指定した値より大きい先頭のインデクスを返します。
        ///
        /// <typeparam name="T">比較する値の型</typeparam>
        /// <param name="arr">対象の配列（※ソート済みであること）</param>
        /// <param name="start">開始インデクス [inclusive]</param>
        /// <param name="end">終了インデクス [exclusive]</param>
        /// <param name="value">検索する値</param>
        /// <param name="comparer">比較関数(インターフェイス)</param>
        /// <returns>指定した値より大きい先頭のインデクス</returns>
        public static int UpperBound<T>(T[] arr, int start, int end, T value, IComparer<T> comparer)
        {
            int low = start;
            int high = end;
            while (low < high)
            {
                var mid = ((high - low) >> 1) + low;
                if (comparer.Compare(arr[mid], value) <= 0)
                    low = mid + 1;
                else
                    high = mid;
            }

            return low;
        }

        ///
        /// 指定した値より大きい先頭のインデクスを返します。
        /// Z
        /// <typeparam name="T">比較する値の型</typeparam>
        /// <param name="arr">対象の配列（※ソート済みであること）</param>
        /// <param name="value">検索する値</param>
        /// <returns>指定した値より大きい先頭のインデクス</returns>
        public static int UpperBound<T>(T[] arr, T value)
        {
            return UpperBound(arr, 0, arr.Length, value, Comparer<T>.Default);
        }

        public static IEnumerable<TResult> SelectNotNull<TSource, TResult>(this IEnumerable<TSource> source,
            Func<TSource, TResult> func)
            => source.Where(val => val != null).Select(func);

        public static IEnumerable<TSource> WhereNotNull<TSource>(this IEnumerable<TSource> source)
            => source.Where(val => val != null);

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static T[] ArrayOf<T>(params T[] arr) => arr;
        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static List<T> ListOf<T>(params T[] arr) => new List<T>(arr);

        public static IList<TSource> MaxBy<TSource, TKey>(this IEnumerable<TSource> source,
            Func<TSource, TKey> keySelector)
        {
            if (source == null) throw new ArgumentNullException(nameof(source));
            if (keySelector == null) throw new ArgumentNullException(nameof(keySelector));
            return MaxBy(source, keySelector, Comparer<TKey>.Default);
        }

        public static IList<TSource> MaxBy<TSource, TKey>(this IEnumerable<TSource> source,
            Func<TSource, TKey> keySelector, IComparer<TKey> comparer)
        {
            if (source == null) throw new ArgumentNullException(nameof(source));
            if (keySelector == null) throw new ArgumentNullException(nameof(keySelector));
            if(comparer==null)throw new ArgumentNullException(nameof(comparer));
            return ExtremaBy(source, keySelector, comparer.Compare);
        }

        public static IList<TSource> MinBy<TSource, TKey>(this IEnumerable<TSource> source,
            Func<TSource, TKey> keySelector)
        {
            if (source == null) throw new ArgumentNullException(nameof(source));
            if (keySelector == null) throw new ArgumentNullException(nameof(keySelector));
            return MinBy(source, keySelector, Comparer<TKey>.Default);
        }

        public static IList<TSource> MinBy<TSource, TKey>(this IEnumerable<TSource> source,
            Func<TSource, TKey> keySelector, IComparer<TKey> comparer)
        {
            if (source == null) throw new ArgumentNullException(nameof(source));
            if (keySelector == null) throw new ArgumentNullException(nameof(keySelector));
            if (comparer == null) throw new ArgumentNullException(nameof(comparer));
            return ExtremaBy(source, keySelector, (key, minValue) => -comparer.Compare(key, minValue));
        }

        private static IList<TSource> ExtremaBy<TSource, TKey>(IEnumerable<TSource> source,
            Func<TSource, TKey> keySelector, Func<TKey, TKey, int> compare)
        {
            var result = new List<TSource>();

            using (var e = source.GetEnumerator())
            {
                if (!e.MoveNext())
                    throw new InvalidOperationException("シーケンスに要素がありませんでした。");

                var current = e.Current;
                var resKey = keySelector(current);
                result.Add(current);

                while (e.MoveNext())
                {
                    var cur = e.Current;
                    var key = keySelector(cur);

                    var cmp = compare(key, resKey);
                    if (cmp == 0)
                    {
                        result.Add(cur);
                    }
                    else if (cmp > 0)
                    {
                        result = new List<TSource> {cur};
                        resKey = key;
                    }
                }
            }

            return result;
        }

        public static IEnumerable<TResult> Repeat<TResult>(TResult value)
        {
            while (true) yield return value;
        }

        public static IEnumerable<TResult> Repeat<TResult>(TResult value, int count)
            => Enumerable.Repeat(value, count);

        public static IEnumerable<TResult> Repeat<TResult>(this IEnumerable<TResult> source, int count)
        {
            if (source == null)throw new ArgumentNullException(nameof(source));
            if(count<0) throw new ArgumentOutOfRangeException(nameof(count));
            for(int i = 0; i < count; i++)
                foreach (var v in source)
                    yield return v;
        }

        [SuppressMessage("ReSharper", "PossibleMultipleEnumeration")]
        public static IEnumerable<TResult> Repeat<TResult>(this IEnumerable<TResult> source)
        {
            if (source == null) throw new ArgumentNullException(nameof(source));
            while(true)
                foreach (var v in source)
                    yield return v;
        }

        ///
        /// 文字の配列を文字列に変換します。
        ///
        /// <param name="source">文字の配列</param>
        /// <returns>変換した文字列</returns>
        public static string AsString(this IEnumerable<char> source) => new string(source.ToArray());

        ///
        /// <see cref="source"/> の累積和を返します。
        ///
        /// <returns><see cref="source"/> の累積和</returns>
        public static IEnumerable<long> CumSum(this IEnumerable<long> source)
        {
            long sum = 0;
            foreach (var item in source)
                yield return sum += item;
        }

        ///
        /// <see cref="source"/> の累積和を返します。
        ///
        /// <returns><see cref="source"/> の累積和</returns>
        public static IEnumerable<int> CumSum(this IEnumerable<int> source)
        {
            int sum = 0;
            foreach (var item in source)
                yield return sum += item;
        }
        ///
        /// <see cref="value"/>が l以上 r未満の範囲に含まれているかを返します。
        ///
        /// <typeparam name="T">要素の型</typeparam>
        /// <param name="value">判定する値</param>
        /// <param name="l">下限の値 (含まれる)</param>
        /// <param name="r">下限の値 (含まれない)</param>
        /// <returns><see cref="value"/> が指定した範囲に含まれているか</returns>
        public static bool IsIn<T>(this T value, T l, T r)
            where T : IComparable<T>
        {
            if (l.CompareTo(r) > 0) throw new ArgumentException();
            return l.CompareTo(value) <= 0 && value.CompareTo(r) < 0;
        }

        ///
        /// <see cref="start"/> 以上 <see cref="end"/> 未満の値を <see cref="step"/> ずつ増やした結果を列挙します。
        ///
        /// <param name="start">値の下限 (含まれる)</param>
        /// <param name="end">値の上限 (含まれない)</param>
        /// <param name="step">1要素ごとに増やす値</param>
        /// <returns>範囲の結果</returns>
        public static IEnumerable<int> Range(int start, int end, int step = 1)
        {
            for (var i = start; i < end; i += step) yield return i;
        }

        ///
        /// 0 以上 <see cref="end"/> 未満の値を 1 ずつ増やした結果を列挙します。
        ///
        /// <param name="end">値の上限 (含まれない)</param>
        /// <returns>範囲の結果</returns>
        public static IEnumerable<int> Range(int end) => Range(0, end);

        ///
        /// <see cref="start"/> 以上 <see cref="end"/> 未満の値を <see cref="step"/> ずつ増やした結果を逆順に列挙します。
        ///
        /// <param name="start">値の下限 (含まれる)</param>
        /// <param name="end">値の上限 (含まれない)</param>
        /// <param name="step">1要素ごとに増やす値</param>
        /// <returns>範囲の結果</returns>
        public static IEnumerable<int> RangeReverse(int start, int end, int step = 1)
        {
            for (var i = end - 1; i >= start; i -= step) yield return i;
        }

        ///
        /// 0 以上 <see cref="end"/> 未満の値を 1 ずつ増やした結果を逆順に列挙します。
        ///
        /// <param name="end">値の上限 (含まれない)</param>
        /// <returns>範囲の結果</returns>
        public static IEnumerable<int> RangeReverse(int end) => RangeReverse(0, end);

        ///
        /// valueを素因数分解し、素因数を列挙します。
        ///
        /// <param name="value">素因数分解する値</param>
        /// <returns>素因数の集合</returns>
        public static IEnumerable<int> Factorize(int value)
        {
            for (int i = 2; i * i < value; i++)
            {
                while (value % i == 0)
                {
                    value /= i;
                    yield return i;
                }
            }

            if (value > 1)
                yield return value;
        }
        ///
        /// valueを素因数分解し、素因数を列挙します。
        ///
        /// <param name="value">素因数分解する値</param>
        /// <returns>素因数の集合</returns>
        public static IEnumerable<long> Factorize(long value)
        {
            for (long i = 2; i * i < value; i++)
            {
                while (value % i == 0)
                {
                    value /= i;
                    yield return i;
                }
            }

            if (value > 1)
                yield return value;
        }
        ///
        /// valueを素因数分解し、素因数とその個数の連想配列を返します。
        ///
        /// <param name="value">素因数分解する値</param>
        /// <returns>素因数の連想配列</returns>
        public static Dictionary<long, int> FactorizeAsMap(long value)
        {
            var dict = new Dictionary<long, int>();

            for (int i = 2; i * i < value; i++)
            {
                if (value % i > 0) continue;
                int cnt = 0;
                while (value % i == 0)
                {
                    value /= i;
                    cnt++;
                }
                dict.Add(i, cnt);
            }

            if (value > 1) dict.Add(value, 1);
            return dict;
        }

        ///
        /// valueを素因数分解し、素因数とその個数の連想配列を返します。
        ///
        /// <param name="value">素因数分解する値</param>
        /// <returns>素因数の連想配列</returns>
        public static Dictionary<int, int> FactorizeAsMap(int value)
        {
            var dict = new Dictionary<int, int>();

            for (int i = 2; i * i < value; i++)
            {
                if (value % i > 0) continue;
                int cnt = 0;
                while (value % i == 0)
                {
                    value /= i;
                    cnt++;
                }
                dict.Add(i, cnt);
            }

            if (value > 1) dict.Add(value, 1);
            return dict;
        }

        ///
        /// 指定した配列をコピーして昇順ソートします。（非破壊的）
        ///
        /// <typeparam name="T">ソートする配列の型</typeparam>
        /// <param name="arr">ソートする配列</param>
        /// <returns>ソートされた配列</returns>
        public static T[] Sort<T>(this T[] arr)
        {
            var array = new T[arr.Length];
            arr.CopyTo(array, 0);
            Array.Sort(array);
            return array;
        }

        ///
        /// 指定した配列をコピーして降順ソートします。（非破壊的）
        ///
        /// <typeparam name="T">ソートする配列の型</typeparam>
        /// <param name="arr">ソートする配列</param>
        /// <returns>ソートされた配列</returns>
        public static T[] SortDescending<T>(this T[] arr)
        {
            var array = new T[arr.Length];
            arr.CopyTo(array, 0);
            Array.Sort(array);
            Array.Reverse(array);
            return array;
        }

        ///
        /// valueの約数の個数を求めます。
        ///
        /// <param name="value">約数の個数を求める数</param>
        /// <returns>valueの約数の個数</returns>
        public static long Divisors(long value)
        {
            var fact = FactorizeAsMap(value);
            return fact.Select(x => x.Value + 1L).Aggregate((m, x) => m * x);
        }

        public static double Log2(double x) => Log(x, 2);
        public static bool chmin(ref int a, int b)
        {
            if (a > b)
            {
                a = b;
                return true;
            }

            return false;
        }
        public static bool chmax(ref int a, int b)
        {
            if (a  b)
            {
                a = b;
                return true;
            }

            return false;
        }
        public static bool chmax(ref long a, long b)
        {
            if (a < b)
            {
                a = b;
                return true;
            }

            return false;
        }
        public static T Min<T>(params T[] col) => col.Min();
        public static T Max<T>(params T[] col) => col.Max();

    }

    public static class Input
    {
        private const char _separator = ' ';
        private static readonly Queue<string> _input = new Queue<string>();
        private static readonly StreamReader sr =
#if FILE
            new StreamReader("in.txt");
#else
            new StreamReader(Console.OpenStandardInput());
#endif

        public static string ReadLine => sr.ReadLine();
        public static string ReadStr => Read;

        public static string Read
        {
            get {
                if (_input.Count != 0) return _input.Dequeue();

                // ReSharper disable once PossibleNullReferenceException
                var tmp = sr.ReadLine().Split(_separator);
                foreach (var val in tmp)
                {
                    _input.Enqueue(val);
                }

                return _input.Dequeue();
            }
        }

        public static int ReadInt => int.Parse(Read);
        public static long ReadLong => long.Parse(Read);
        public static double ReadDouble => double.Parse(Read);
        public static string[] StrArray() => ReadLine.Split(' ');
        public static int[] IntArray() => ReadLine.Split(' ').Select(int.Parse).ToArray();
        public static long[] LongArray() => ReadLine.Split(' ').Select(long.Parse).ToArray();

        public static string[] StrArray(int n)
        {
            var ret = new string[n];
            for (long i = 0; i < n; ++i) ret[i] = Read;
            return ret;
        }

        public static int[] IntArray(int n, int offset = 0, bool sorted = false)
        {
            var ret = StrArray(n).Select(x => int.Parse(x) + offset).ToArray();
            if (sorted) Array.Sort(ret);
            return ret;
        }

        public static long[] LongArray(int n, long offset = 0, bool sorted = false)
        {
            var ret = StrArray(n).Select(x => long.Parse(x) + offset).ToArray();
            if (sorted) Array.Sort(ret);
            return ret;
        }

        public static string[][] Str2DArray(int n, int m)
            => Enumerable.Repeat((string[]) null, n).Select(_ => StrArray(m)).ToArray();
        public static int[][] Int2DArray(int n, int m, int offset = 0)
            => Enumerable.Repeat((int[]) null, n).Select(_ => IntArray(m, offset)).ToArray();

        public static long[][] Long2DArray(int n, int m, long offset = 0)
            => Enumerable.Repeat((long[]) null, n).Select(_ => LongArray(m, offset)).ToArray();

        public static Tuple<string[], string[]> StrArrays2(int n)
        {
            var ret1 = new string[n];
            var ret2 = new string[n];
            for (int i = 0; i < n; i++)
            {
                ret1[i] = ReadStr;
                ret2[i] = ReadStr;
            }

            return Tuple.Create(ret1, ret2);
        }
        public static Tuple<int[], int[]> IntArrays2(int n, int offset1 = 0, int offset2 = 0)
        {
            var ret1 = new int[n];
            var ret2 = new int[n];
            for (int i = 0; i < n; i++)
            {
                ret1[i] = ReadInt + offset1;
                ret2[i] = ReadInt + offset2;
            }

            return Tuple.Create(ret1, ret2);
        }

        public static Tuple<long[], long[]> LongArrays2(int n, long offset1 = 0, long offset2 = 0)
        {
            var ret1 = new long[n];
            var ret2 = new long[n];
            for (int i = 0; i < n; i++)
            {
                ret1[i] = ReadLong + offset1;
                ret2[i] = ReadLong + offset2;
            }

            return Tuple.Create(ret1, ret2);
        }

        public static Tuple<string[], string[], string[]> StrArrays3(int n)
        {
            var ret1 = new string[n];
            var ret2 = new string[n];
            var ret3 = new string[n];
            for (int i = 0; i < n; i++)
            {
                ret1[i] = ReadStr;
                ret2[i] = ReadStr;
            }

            return Tuple.Create(ret1, ret2, ret3);
        }
        public static Tuple<int[], int[], int[]> IntArrays3(int n, int offset1 = 0, int offset2 = 0, int offset3 = 0)
        {
            var ret1 = new int[n];
            var ret2 = new int[n];
            var ret3 = new int[n];
            for (int i = 0; i < n; i++)
            {
                ret1[i] = ReadInt + offset1;
                ret2[i] = ReadInt + offset2;
                ret3[i] = ReadInt + offset3;
            }

            return Tuple.Create(ret1, ret2, ret3);
        }

        public static Tuple<long[], long[], long[]> LongArrays3(int n, long offset1 = 0, long offset2 = 0, long offset3 = 0)
        {
            var ret1 = new long[n];
            var ret2 = new long[n];
            var ret3 = new long[n];
            for (int i = 0; i < n; i++)
            {
                ret1[i] = ReadLong + offset1;
                ret2[i] = ReadLong + offset2;
                ret3[i] = ReadLong + offset3;
            }

            return Tuple.Create(ret1, ret2, ret3);
        }

        static bool TypeEquals<T, U>() => typeof(T) == typeof(U);
        static T ChangeType<T, U>(U a) => (T)System.Convert.ChangeType(a, typeof(T));

        static T Convert<T>(string s) => TypeEquals<T, int>() ? ChangeType<T, int>(int.Parse(s))
            : TypeEquals<T, long>() ? ChangeType<T, long>(long.Parse(s))
            : TypeEquals<T, double>() ? ChangeType<T, double>(double.Parse(s))
            : TypeEquals<T, char>() ? ChangeType<T, char>(s[0])
            : ChangeType<T, string>(s);

        public static bool In<T>(out T a)
        {
            try
            {
                a = Convert<T>(Read);
                return true;
            }
            catch
            {
                a = default(T);
                return false;
            }
        }

        public static bool In<T, U>(out T a, out U b)
        {
            try
            {
                var ar = StrArray(2);
                a = Convert<T>(ar[0]);
                b = Convert(ar[1]);
                return true;
            }
            catch
            {
                a = default(T);
                b = default(U);
                return false;
            }
        }

        public static bool In<T, U, V>(out T a, out U b, out V c)
        {
            try
            {
                var ar = StrArray(3);
                a = Convert<T>(ar[0]);
                b = Convert(ar[1]);
                c = Convert<V>(ar[2]);
                return true;
            }
            catch
            {
                a = default(T);
                b = default(U);
                c = default(V);
                return false;
            }
        }

        public static bool In<T, U, V, W>(out T a, out U b, out V c, out W d)
        {
            try
            {
                var ar = StrArray(4);
                a = Convert<T>(ar[0]);
                b = Convert(ar[1]);
                c = Convert<V>(ar[2]);
                d = Convert<W>(ar[3]);
                return true;
            }
            catch
            {
                a = default(T);
                b = default(U);
                c = default(V);
                d = default(W);
                return false;
            }
        }

        public static bool In<T, U, V, W, X>(out T a, out U b, out V c, out W d, out X e)
        {
            try
            {
                var ar = StrArray(5);
                a = Convert<T>(ar[0]);
                b = Convert(ar[1]);
                c = Convert<V>(ar[2]);
                d = Convert<W>(ar[3]);
                e = Convert<X>(ar[4]);
                return true;
            }
            catch
            {
                a = default(T);
                b = default(U);
                c = default(V);
                d = default(W);
                e = default(X);
                return false;
            }
        }
        ///
        /// 要素数 (a, b) の、defaultValue で満たされた配列を作成します。
        ///
        /// <typeparam name="T">配列の型</typeparam>
        /// <param name="a">1次元の要素数</param>
        /// <param name="b">2次元の要素数</param>
        /// <param name="defaultValue">デフォルト値</param>
        /// <returns>指定した条件で初期化された配列</returns>
        public static T[][] Array2D<T>(int a, int b, T defaultValue = default(T))
        {
            var ret = new T[a][];
            for (int i = 0; i < a; i++)
            {
                ret[i] = Enumerable.Repeat(defaultValue, b).ToArray();
            }

            return ret;
        }
    }

    public class Program
    {
        public static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
            Console.SetOut(sw);
            new Solver().Solve();

            Console.Out.Flush();
            Console.Read();
        }
    }

    [System.Diagnostics.DebuggerDisplay("({first}, {second})")]
    public class Pair<T1, T2> : IComparable<Pair<T1, T2>>, IEquatable<Pair<T1, T2>>
        where T1 : IComparable<T1>
        where T2 : IComparable<T2>
    {
        public Pair(T1 first, T2 second)
        {
            this.first = first;
            this.second = second;
        }

        public T1 first;
        public T2 second;

        public int CompareTo(Pair<T1, T2> other)
        {
            if (ReferenceEquals(this, other)) return 0;
            if (ReferenceEquals(null, other)) return 1;
            var firstComparison = first.CompareTo(other.first);
            return firstComparison != 0 ? firstComparison : second.CompareTo(other.second);
        }

        public override string ToString() => $"({first}, {second})";

        public bool Equals(Pair<T1, T2> other)
        {
            if (ReferenceEquals(null, other)) return false;
            if (ReferenceEquals(this, other)) return true;
            return EqualityComparer<T1>.Default.Equals(first, other.first) && EqualityComparer<T2>.Default.Equals(second, other.second);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            return obj.GetType() == this.GetType() && Equals((Pair<T1, T2>)obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                return (EqualityComparer<T1>.Default.GetHashCode(first) * 397) ^ EqualityComparer<T2>.Default.GetHashCode(second);
            }
        }
    }

    #endregion

    //ライブラリ置き場

    //ライブラリここまで

    public class Solver
    {
        private const int MOD = (int) 1e9 + 7,
            INF = 1000000010;

        //解答
        public void Solve()
        {
            int q = ReadInt;
            for (int i = 0; i < q; i++)
            {
                int N = ReadInt, k = ReadInt;
                int[] a = IntArray(N);
                long sum = 0;
                var ans = new List<int>();
                int j;
                for (j = 0; j < N; j++)
                {
                    if (ans.Count == k - 1)
                    {
                        break;
                    }
                    sum += a[j];
                    if ((sum & 1) != 0)
                    {
                        ans.Add(j + 1);
                        sum = 0;
                    }
                }

                if (j == N - 1)
                {
                    Console.WriteLine("NO");
                    continue;
                }
                var nokori = a.Skip(j).Sum();
                ans.Add(N);
                if((nokori & 1) == 0) Console.WriteLine("NO");
                else
                {
                    Console.WriteLine("YES");
                    Console.WriteLine(ans.Join(" "));
                }

            }

        }

    }
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;

const long long INF=~0ull>>1;
const int inf=0x3f3f3f3f;

int x[6]={0,500,1000,1500,2000,2500};
int m[6],w[6],h[2],a[6],ans;

int main()
{
#ifdef LOCAL
    freopen("in.txt","r",stdin);
#endif
    while(~scanf("%d %d %d %d %d",&m[1],&m[2],&m[3],&m[4],&m[5]))
    {
        for(int i=1;i<=5;i++)
            scanf("%d",&w[i]);
        for(int i=0;i<2;i++)
            scanf("%d",&h[i]);
        ans=0;
        for(int i=1;i<=5;i++)
        {
            a[i]=max((int)(0.3*x[i]-0.5),(250-m[i])*x[i]/250-50*w[i]);
            ans+=a[i];
        }
        ans+=h[0]*100-h[1]*50;
        if(ans<0) ans=0;
        printf("%d\n",ans);

    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;

const long long INF=~0ull>>1;
const int inf=0x3f3f3f3f;

int x[6]={0,500,1000,1500,2000,2500};
int m[6],w[6],h[2],a[6],ans;

int main()
{
#ifdef LOCAL
    freopen("in.txt","r",stdin);
#endif
    while(~scanf("%d %d %d %d %d",&m[1],&m[2],&m[3],&m[4],&m[5]))
    {
        for(int i=1;i<=5;i++)
            scanf("%d",&w[i]);
        for(int i=0;i<2;i++)
            scanf("%d",&h[i]);
        ans=0;
        for(int i=1;i<=5;i++)
        {
            a[i]=max(i*150,(250-m[i])*i*2-50*w[i]);
            ans+=a[i];
        }
        ans+=h[0]*100-h[1]*50;
        //if(ans<0) ans=0;
        printf("%d\n",ans);

    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;

const long long INF=~0ull>>1;
const int inf=0x3f3f3f3f;

int x[6]={0,500,1000,1500,2000,2500};
int m[6],w[6],h[2],a[6],ans;

int main()
{
#ifdef LOCAL
    freopen("in.txt","r",stdin);
#endif
    while(~scanf("%d %d %d %d %d",&m[1],&m[2],&m[3],&m[4],&m[5]))
    {
        for(int i=1;i<=5;i++)
            scanf("%d",&w[i]);
        for(int i=0;i<2;i++)
            scanf("%d",&h[i]);
        ans=0;
        for(int i=1;i<=5;i++)
        {
            a[i]=max(i*150,(250-m[i])*i*2-50*w[i]);
            ans+=a[i];
        }
        ans+=h[0]*100-h[1]*50;
        if(ans<0) ans=0;
        printf("%d\n",ans);

    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <iostream>
#include <cmath>
using namespace std;

const long long INF=~0ull>>1;
const int inf=0x3f3f3f3f;

int x[6]={0,500,1000,1500,2000,2500};
int m[6],w[6],h[2],a[6],ans;

int main()
{
#ifdef LOCAL
    freopen("in.txt","r",stdin);
#endif
    while(~scanf("%d %d %d %d %d",&m[1],&m[2],&m[3],&m[4],&m[5]))
    {
        for(int i=1;i<=5;i++)
            scanf("%d",&w[i]);
        for(int i=0;i<2;i++)
            scanf("%d",&h[i]);
        ans=0;
        for(int i=1;i<=5;i++)
        {
            a[i]=max(0.3*x[i],(1-m[i]*1.0/250)*x[i]-50*w[i]);
            ans+=a[i];
        }
        ans+=h[0]*100-h[1]*50;
        //if(ans<0) ans=0;
        printf("%d\n",ans);

    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define fi 			"input.txt"
#define fo 			"output.txt"
#define sz(a) 		int(a.size())
#define fill(a, b) 	memset (a, b, sizeof(a))
#define init(a) 	memset (a, 0, sizeof(a))
#define	st 			first
#define nd 			second
#define pb 			push_back
#define mp 			make_pair
#define all(v) 		v.begin(), v.end()
#define SORT(v, n)	sort(v.begin(), v.begin()+n)

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vec;

const ll INF = 1LL << 60;
const ld EPS = 1e-12;
const ld PI = acos(-1);

//	VARIABLES
//clock_t strt, fnsh;
int max_score[5] = {500, 1000, 1500, 2000, 2500};
int minute[5];
int submission[5];
int succ_hack, fail_hack;
int res = 0;

//	FUNCTIONS
bool isUpper(char c) 	{return c >= 'A' && c <= 'Z';}
bool isLower(char c) 	{return c >= 'a' && c <= 'z';}
bool isLetter(char c) 	{return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z';}
bool isDigit(char c) 	{return c >= '0' && c <= '9';}
char toLower(char c) 	{return (isUpper(c)) ? (c + 32) : c;}
char toUpper(char c) 	{return (isLower(c)) ? (c - 32) : c;}
bool isPowOf2(int i)	{return (i & i-1) == 0;}
bool srtDes(ll x, ll y) {return (x > y);}
ll gcd(ll a, ll b) 		{while (b) {ll temp = a % b; a = b, b = temp;} return a;}
ll lcm(ll x, ll y) 		{return x * y / gcd (x, y);}
bool isPrime(ull n) {
	if (n <= 1)		return false;
	if (n <= 3)		return true;
	if (n % 2 == 0)	return false;
	if (n % 3 == 0)	return false;
	for (ull i = 5; i <= sqrt(n); i = i + 6)
		if (n % i == 0 || n % (i+2) == 0)
			return false;
	return true;
}

void input();
void solve();
void output();

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	input();
	solve();
	output();
	return 0;
}

void input() {
	//strt = clock();
	//freopen(fi, "r", stdin);
	for (int i = 0; i < 5; i++) {
		cin >> minute[i];
	}
	for (int i = 0; i < 5; i++) {
		cin >> submission[i];
	}
	cin >> succ_hack >> fail_hack;
	//fclose(stdin);
	return;
}

void solve() {
	for (int i = 0; i < 5; i++) {
		int a = 0.3 * max_score[i];
		int b = max_score[i] - minute[i] * max_score[i]/250  - 50 * submission[i];
		if (a > b)
			res += a;
		else
			res += b;
	}
	res += succ_hack * 100 - fail_hack * 50;
	return;
}

void output() {
	//freopen(fo, "w", stdout);
	cout << (int) res << endl;
	//fclose(stdout);
	//fnsh = clock();
	//float diff = (float)fnsh - (float)strt;
	//cout << "The program ran in " << diff / CLOCKS_PER_SEC << " seconds." << endl;
	return;
}


#include <bits/stdc++.h>

using namespace std;

#define fi 			"input.txt"
#define fo 			"output.txt"
#define sz(a) 		int(a.size())
#define fill(a, b) 	memset (a, b, sizeof(a))
#define init(a) 	memset (a, 0, sizeof(a))
#define	st 			first
#define nd 			second
#define pb 			push_back
#define mp 			make_pair
#define all(v) 		v.begin(), v.end()
#define SORT(v, n)	sort(v.begin(), v.begin()+n)

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vec;

const ll INF = 1LL << 60;
const ld EPS = 1e-12;
const ld PI = acos(-1);

//	VARIABLES
//clock_t strt, fnsh;
double max_s[5] = {500, 1000, 1500, 2000, 2500};
int mnt[5], sub[5];
int succ_hack, fail_hack;
int res = 0;

//	FUNCTIONS
bool isUpper(char c) 	{return c >= 'A' && c <= 'Z';}
bool isLower(char c) 	{return c >= 'a' && c <= 'z';}
bool isLetter(char c) 	{return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z';}
bool isDigit(char c) 	{return c >= '0' && c <= '9';}
char toLower(char c) 	{return (isUpper(c)) ? (c + 32) : c;}
char toUpper(char c) 	{return (isLower(c)) ? (c - 32) : c;}
bool isPowOf2(int i)	{return (i & i-1) == 0;}
bool srtDes(ll x, ll y) {return (x > y);}
ll gcd(ll a, ll b) 		{while (b) {ll temp = a % b; a = b, b = temp;} return a;}
ll lcm(ll x, ll y) 		{return x * y / gcd (x, y);}
bool isPrime(ull n) {
	if (n <= 1)		return false;
	if (n <= 3)		return true;
	if (n % 2 == 0)	return false;
	if (n % 3 == 0)	return false;
	for (ull i = 5; i <= sqrt(n); i = i + 6)
		if (n % i == 0 || n % (i+2) == 0)
			return false;
	return true;
}

void input();
void solve();
void output();

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	input();
	solve();
	output();
	return 0;
}

void input() {
	//strt = clock();
	//freopen(fi, "r", stdin);
	for (int i = 0; i < 5; i++) {
		cin >> mnt[i];
	}
	for (int j = 0; j < 5; j++) {
		cin >> sub[j];
	}
	cin >> succ_hack >> fail_hack;
	//fclose(stdin);
	return;
}

void solve() {
	for (int i = 0; i < 5; i++) {
		res += max(3 * max_s[i] / 10, max_s[i] - mnt[i]*max_s[i]/250 - 50*sub[i]);
	}
	res += succ_hack * 100;
	res -= fail_hack * 50;
	return;
}

void output() {
	//freopen(fo, "w", stdout);
	cout << res << endl;
	//fclose(stdout);
	//fnsh = clock();
	//float diff = (float)fnsh - (float)strt;
	//cout << "The program ran in " << diff / CLOCKS_PER_SEC << " seconds." << endl;
	return;
}


#include <bits/stdc++.h>

using namespace std;

#define fi 			"input.txt"
#define fo 			"output.txt"
#define sz(a) 		int(a.size())
#define fill(a, b) 	memset (a, b, sizeof(a))
#define init(a) 	memset (a, 0, sizeof(a))
#define	st 			first
#define nd 			second
#define pb 			push_back
#define mp 			make_pair
#define all(v) 		v.begin(), v.end()
#define SORT(v, n)	sort(v.begin(), v.begin()+n)

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vec;

const ll INF = 1LL << 60;
const ld EPS = 1e-12;
const ld PI = acos(-1);

//	VARIABLES
//clock_t strt, fnsh;
double max_score[5] = {500, 1000, 1500, 2000, 2500};
double minute[5];
double submission[5];
int succ_hack, fail_hack;
int res = 0;

//	FUNCTIONS
bool isUpper(char c) 	{return c >= 'A' && c <= 'Z';}
bool isLower(char c) 	{return c >= 'a' && c <= 'z';}
bool isLetter(char c) 	{return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z';}
bool isDigit(char c) 	{return c >= '0' && c <= '9';}
char toLower(char c) 	{return (isUpper(c)) ? (c + 32) : c;}
char toUpper(char c) 	{return (isLower(c)) ? (c - 32) : c;}
bool isPowOf2(int i)	{return (i & i-1) == 0;}
bool srtDes(ll x, ll y) {return (x > y);}
ll gcd(ll a, ll b) 		{while (b) {ll temp = a % b; a = b, b = temp;} return a;}
ll lcm(ll x, ll y) 		{return x * y / gcd (x, y);}
bool isPrime(ull n) {
	if (n <= 1)		return false;
	if (n <= 3)		return true;
	if (n % 2 == 0)	return false;
	if (n % 3 == 0)	return false;
	for (ull i = 5; i <= sqrt(n); i = i + 6)
		if (n % i == 0 || n % (i+2) == 0)
			return false;
	return true;
}

void input();
void solve();
void output();

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	input();
	solve();
	output();
	return 0;
}

void input() {
	//strt = clock();
	//freopen(fi, "r", stdin);
	for (int i = 0; i < 5; i++) {
		cin >> minute[i];
	}
	for (int i = 0; i < 5; i++) {
		cin >> submission[i];
	}
	cin >> succ_hack >> fail_hack;
	//fclose(stdin);
	return;
}

void solve() {
	for (int i = 0; i < 5; i++) {
		res += max(0.3 * max_score[i], max_score[i] - minute[i] * max_score[i]/250  - 50 * submission[i]);
	}
	res += succ_hack * 100 - fail_hack * 50;
	return;
}

void output() {
	//freopen(fo, "w", stdout);
	cout << (int) res << endl;
	//fclose(stdout);
	//fnsh = clock();
	//float diff = (float)fnsh - (float)strt;
	//cout << "The program ran in " << diff / CLOCKS_PER_SEC << " seconds." << endl;
	return;
}


#include <bits/stdc++.h>

using namespace std;

#define fi 			"input.txt"
#define fo 			"output.txt"
#define sz(a) 		int(a.size())
#define fill(a, b) 	memset (a, b, sizeof(a))
#define init(a) 	memset (a, 0, sizeof(a))
#define	st 			first
#define nd 			second
#define pb 			push_back
#define mp 			make_pair
#define all(v) 		v.begin(), v.end()
#define SORT(v, n)	sort(v.begin(), v.begin()+n)

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vec;

const ll INF = 1LL << 60;
const ld EPS = 1e-12;
const ld PI = acos(-1);

//	VARIABLES
//clock_t strt, fnsh;
double max_s[5] = {500, 1000, 1500, 2000, 2500};
int min[5], sub[5];
int succ_hack, fail_hack;
int res = 0;

//	FUNCTIONS
bool isUpper(char c) 	{return c >= 'A' && c <= 'Z';}
bool isLower(char c) 	{return c >= 'a' && c <= 'z';}
bool isLetter(char c) 	{return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z';}
bool isDigit(char c) 	{return c >= '0' && c <= '9';}
char toLower(char c) 	{return (isUpper(c)) ? (c + 32) : c;}
char toUpper(char c) 	{return (isLower(c)) ? (c - 32) : c;}
bool isPowOf2(int i)	{return (i & i-1) == 0;}
bool srtDes(ll x, ll y) {return (x > y);}
ll gcd(ll a, ll b) 		{while (b) {ll temp = a % b; a = b, b = temp;} return a;}
ll lcm(ll x, ll y) 		{return x * y / gcd (x, y);}
bool isPrime(ull n) {
	if (n <= 1)		return false;
	if (n <= 3)		return true;
	if (n % 2 == 0)	return false;
	if (n % 3 == 0)	return false;
	for (ull i = 5; i <= sqrt(n); i = i + 6)
		if (n % i == 0 || n % (i+2) == 0)
			return false;
	return true;
}

void input();
void solve();
void output();

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	input();
	solve();
	output();
	return 0;
}

void input() {
	//strt = clock();
	//freopen(fi, "r", stdin);
	for (int i = 0; i < 5; i++) {
		cin >> min[i];
	}
	for (int j = 0; j < 5; j++) {
		cin >> sub[i];
	}
	cin >> succ_hack >> fail_hack;
	//fclose(stdin);
	return;
}

void solve() {
	for (int i = 0; i < 5; i++) {
		res += max(3 * max_s[i] / 10, max_s[i] - min[i]*max_s[i]/250 - 50*sub[i]);
	}
	res += succ_hack * 100;
	res -= fail_hack * 50;
	return;
}

void output() {
	//freopen(fo, "w", stdout);
	cout << res << endl;
	//fclose(stdout);
	//fnsh = clock();
	//float diff = (float)fnsh - (float)strt;
	//cout << "The program ran in " << diff / CLOCKS_PER_SEC << " seconds." << endl;
	return;
}


#include <bits/stdc++.h>

using namespace std;

#define fi 			"input.txt"
#define fo 			"output.txt"
#define sz(a) 		int(a.size())
#define fill(a, b) 	memset (a, b, sizeof(a))
#define init(a) 	memset (a, 0, sizeof(a))
#define	st 			first
#define nd 			second
#define pb 			push_back
#define mp 			make_pair
#define all(v) 		v.begin(), v.end()
#define SORT(v, n)	sort(v.begin(), v.begin()+n)

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vec;

const ll INF = 1LL << 60;
const ld EPS = 1e-12;
const ld PI = acos(-1);

//	VARIABLES
//clock_t strt, fnsh;
int max_score[5] = {500, 1000, 1500, 2000, 2500};
int minute[5];
int submission[5];
int succ_hack, fail_hack;
ll res = 0;

//	FUNCTIONS
bool isUpper(char c) 	{return c >= 'A' && c <= 'Z';}
bool isLower(char c) 	{return c >= 'a' && c <= 'z';}
bool isLetter(char c) 	{return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z';}
bool isDigit(char c) 	{return c >= '0' && c <= '9';}
char toLower(char c) 	{return (isUpper(c)) ? (c + 32) : c;}
char toUpper(char c) 	{return (isLower(c)) ? (c - 32) : c;}
bool isPowOf2(int i)	{return (i & i-1) == 0;}
bool srtDes(ll x, ll y) {return (x > y);}
ll gcd(ll a, ll b) 		{while (b) {ll temp = a % b; a = b, b = temp;} return a;}
ll lcm(ll x, ll y) 		{return x * y / gcd (x, y);}
bool isPrime(ull n) {
	if (n <= 1)		return false;
	if (n <= 3)		return true;
	if (n % 2 == 0)	return false;
	if (n % 3 == 0)	return false;
	for (ull i = 5; i <= sqrt(n); i = i + 6)
		if (n % i == 0 || n % (i+2) == 0)
			return false;
	return true;
}

void input();
void solve();
void output();

int main() {
	//ios::sync_with_stdio(false);
	//cin.tie(NULL);
	input();
	solve();
	output();
	return 0;
}

void input() {
	//strt = clock();
	//freopen(fi, "r", stdin);
	for (int i = 0; i < 5; i++) {
		cin >> minute[i];
	}
	for (int i = 0; i < 5; i++) {
		cin >> submission[i];
	}
	cin >> succ_hack >> fail_hack;
	//fclose(stdin);
	return;
}

void solve() {
	for (int i = 0; i < 5; i++) {
		int a = 0.3 * max_score[i];
		int b = (1 - minute[i]/250) * max_score[i]  - 50 * submission[i];
		if (a > b)
			res += a;
		else
			res += b;
	}
	res += succ_hack * 100 - fail_hack * 50;
	return;
}

void output() {
	//freopen(fo, "w", stdout);
	cout << (int) res << endl;
	//fclose(stdout);
	//fnsh = clock();
	//float diff = (float)fnsh - (float)strt;
	//cout << "The program ran in " << diff / CLOCKS_PER_SEC << " seconds." << endl;
	return;
}


#include <bits/stdc++.h>

using namespace std;

#define fi 			"input.txt"
#define fo 			"output.txt"
#define sz(a) 		int(a.size())
#define fill(a, b) 	memset (a, b, sizeof(a))
#define init(a) 	memset (a, 0, sizeof(a))
#define	st 			first
#define nd 			second
#define pb 			push_back
#define mp 			make_pair
#define all(v) 		v.begin(), v.end()
#define SORT(v, n)	sort(v.begin(), v.begin()+n)

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vec;

const ll INF = 1LL << 60;
const ld EPS = 1e-12;
const ld PI = acos(-1);

//	VARIABLES
//clock_t strt, fnsh;
double max_score[5] = {500, 1000, 1500, 2000, 2500};
double minute[5];
double submission[5];
int succ_hack, fail_hack;
int res = 0;

//	FUNCTIONS
bool isUpper(char c) 	{return c >= 'A' && c <= 'Z';}
bool isLower(char c) 	{return c >= 'a' && c <= 'z';}
bool isLetter(char c) 	{return c >= 'A' && c <= 'Z' || c >= 'a' && c <= 'z';}
bool isDigit(char c) 	{return c >= '0' && c <= '9';}
char toLower(char c) 	{return (isUpper(c)) ? (c + 32) : c;}
char toUpper(char c) 	{return (isLower(c)) ? (c - 32) : c;}
bool isPowOf2(int i)	{return (i & i-1) == 0;}
bool srtDes(ll x, ll y) {return (x > y);}
ll gcd(ll a, ll b) 		{while (b) {ll temp = a % b; a = b, b = temp;} return a;}
ll lcm(ll x, ll y) 		{return x * y / gcd (x, y);}
bool isPrime(ull n) {
	if (n <= 1)		return false;
	if (n <= 3)		return true;
	if (n % 2 == 0)	return false;
	if (n % 3 == 0)	return false;
	for (ull i = 5; i <= sqrt(n); i = i + 6)
		if (n % i == 0 || n % (i+2) == 0)
			return false;
	return true;
}

void input();
void solve();
void output();

int main() {
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	input();
	solve();
	output();
	return 0;
}

void input() {
	//strt = clock();
	//freopen(fi, "r", stdin);
	for (int i = 0; i < 5; i++) {
		cin >> minute[i];
	}
	for (int i = 0; i < 5; i++) {
		cin >> submission[i];
	}
	cin >> succ_hack >> fail_hack;
	//fclose(stdin);
	return;
}

void solve() {
	for (int i = 0; i < 5; i++) {
		res += max(0.3 * max_score[i], (1 - minute[i]/250) * max_score[i]  - 50 * submission[i]);
	}
	res += succ_hack * 100;
	res -= fail_hack * 50;
	return;
}

void output() {
	//freopen(fo, "w", stdout);
	cout << (int) res << endl;
	//fclose(stdout);
	//fnsh = clock();
	//float diff = (float)fnsh - (float)strt;
	//cout << "The program ran in " << diff / CLOCKS_PER_SEC << " seconds." << endl;
	return;
}


#include <stdio.h>
#include <algorithm>
#include <iostream>

double _max[] = {500.0, 1000.0, 1500.0, 2000.0, 2500.0};
using namespace std;

int main() {
        double min[5];
        double wrg[5];
        int h1, h2;
        int output = 0;

        scanf("%lf %lf %lf %lf %lf", &min[0], &min[1], &min[2], &min[3], &min[4]);
        scanf("%lf %lf %lf %lf %lf", &wrg[0], &wrg[1], &wrg[2], &wrg[3], &wrg[4]);
        scanf("%d %d", &h1, &h2);

        for(int count = 0; count < 5; ++count) {
                output += max(0.3 * _max[count], (1 - min[count]/250) * _max[count] - 50 * wrg[count]);
        }

        output += (100 * h1) - (50 * h2);

        cout << output << endl;

        return 0;
}
// 1449233550928


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define INF 0x3f3f3f
#define fi first
#define se second
#define DEBUG if(0)
#define MAX 30
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
typedef tuple<int,bool> ib;

int sum( int idx, int times, int ten )
{
	return (250-times)*(idx*2) - 50*ten;
}
int main()
{
	int m[5];
	int erros[5];
	int hack, unhack;
	int ans = 0;
	for (int i = 0; i < 5; ++i)
		scanf("%d", m+i);
	for (int i = 0; i < 5; ++i)
		scanf("%d", erros+i);
	cin >> hack >> unhack;
	for (int i = 0; i < 5; ++i)
	{
		ans += max( sum(i+1, m[i], erros[i]), (i+1)*(50)*(3) );
	}
	printf("%d\n", ans + 100*hack - 50*unhack );
	return 0;
}
// 1449228913479


#include <bits/stdc++.h>

long double _max[] = {500.0, 1000.0, 1500.0, 2000.0, 2500.0};

using namespace std;

int main() {
        long double minutes[5];
        long double wrongs[5];
        int h1, h2;
        int output = 0;

        scanf("%Lf %Lf %Lf %Lf %Lf", &minutes[0], &minutes[1], &minutes[2], &minutes[3], &minutes[4]);
        scanf("%Lf %Lf %Lf %Lf %Lf", &wrongs[0], &wrongs[1], &wrongs[2], &wrongs[3], &wrongs[4]);
        scanf("%d %d", &h1, &h2);

        for(int count = 0; count < 5; ++count) {
                output += max(0.3 * _max[count], ((250.0 - minutes[count])/250.0) * _max[count] - 50 * wrongs[count]);
        }

        output += (100 * h1) - (50*h2);

        cout << output << endl;

        return 0;
}
// 1449232169528


#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int llu;
typedef long long ll;

int main()
{
    vector <int> m;
    int c;
    for (int i=0;i<5;i++)
    {
        cin>>c;
        m.push_back(c);
    }

    vector <int> w;

    for (int i =0;i<5;i++)
    {
        cin>>c;
        w.push_back(c);
    }

    int s,u;
    cin>>s>>u;

    double aux;
    double sum = 0;

    for (int i =0;i<5;i++)
    {
        aux = max( ((0.3*(i+1)*500)) , ( ((1-(m[i]/250.0))*(i+1)*500)-(50*w[i]) ) );
        //cout<<aux<<endl;
        sum+=aux;
    }
    sum+=(s*100);
    sum-=(u*50);

    cout<<sum<<endl;

    return 0;
}
// 1461163931990


#include <bits/stdc++.h>

using namespace std;

double maxPoint[] = {500.0, 1000.0, 1500.0, 2000.0, 2500.0};

int main(void) {
    double min[5];
    double wrg[5];
    int h1, h2;
    int output = 0;

    scanf("%lf%lf%lf%lf%lf", &min[0], &min[1], &min[2], &min[3], &min[4]);
    scanf("%lf%lf%lf%lf%lf", &wrg[0], &wrg[1], &wrg[2], &wrg[3], &wrg[4]);
    scanf("%d%d", &h1, &h2);

    for(int count = 0; count < 5; ++count) {
        output += max(0.3 * maxPoint[count], ((maxPoint[count] * 250.0) - maxPoint[count] * min[count])/250.0 - 50 * wrg[count]);
    }

    output += (100 * h1) - (50 * h2);

    cout << output << endl;

    return 0;
}
// 1449232600397


#include <bits/stdc++.h>

long double max[] = {500, 1000, 1500, 2000, 2500};

int main() {
        long double minutes[5];
        long double wrongs[5];
        int h1, h2;
        int output = 0;

        scanf("%Lf %Lf %Lf %Lf %Lf", &minutes[0], &minutes[1], &minutes[2], &minutes[3], &minutes[4]);
        scanf("%Lf %Lf %Lf %Lf %Lf", &wrongs[0], &wrongs[1], &wrongs[2], &wrongs[3], &wrongs[4]);
        scanf("%d %d", &h1, &h2);

        for(int count = 0; count < 5; ++count) {
                output += std::max(0.3 * max[count], (1 - minutes[count]/250) * max[count] - 50 * wrongs[count]);
        }

        output += (100 * h1) - (50*h2);

        std::cout << output << std::endl;

        return 0;
}
// 1449229870302


/*
    Janderson Angelo - UFAL
*/

#include <bits/stdc++.h>

#define DEBUG 1
#define D(value) if (DEBUG) cout << value << endl;

#define REP(i, a, b) \
    for (int i = int(a); i < int(b); i++) // a to b, and variable i is local!
#define file() \
    freopen("in", "r", stdin);\
    freopen("out", "w", stdout);

using namespace std;

int main()
{
	//file();
	int values[5] = {500, 1000, 1500, 2000, 2500};
    int subm[5];
    REP(i,0,5){
    	cin >> subm[i];
    }
    int wrong[5];
    REP(i,0,5){
    	cin >> wrong[i];
    }
    long long int sum = 0;
    REP(i,0,5){
    	double x = values[i];
    	double m = subm[i];
    	double w = wrong[i];
    	double b1 = 0.3*x;
    	double b2 = ((1.0-(m/250.0)) * x - (50.0*w));
    	D("b2 = " << b2)
    	double biggest;
    	if(b1 >= b2){
    		biggest = b1;
    	}else{
    		biggest = b2;
    	}
    	sum += biggest;
    	D("problem " << i << " got " << biggest)
    }
    int sus, unsus;
    cin >> sus >> unsus;
    sum += sus * 100;
    sum -= unsus * 50;
    cout << sum << endl;
}
// 1449230584641


#include <bits/stdc++.h>

long double max[] = {500, 1000, 1500, 2000, 2500};

int main() {
        long double minutes[5];
        long double wrongs[5];
        int h1, h2;
        int output = 0;

        scanf("%Lf %Lf %Lf %Lf %Lf", &minutes[0], &minutes[1], &minutes[2], &minutes[3], &minutes[4]);
        scanf("%Lf %Lf %Lf %Lf %Lf", &wrongs[0], &wrongs[1], &wrongs[2], &wrongs[3], &wrongs[4]);
        scanf("%d %d", &h1, &h2);

        for(int count = 0; count < 5; ++count) {
                output += std::max(0.3 * max[count], (max[count] - (minutes[count]*max[count])/250.0) - 50 * wrongs[count]);
        }

        output += (100 * h1) - (50*h2);

        std::cout << output << std::endl;

        return 0;
}
// 1449230865081


#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
#define pb push_back
#define sqr(x) ((x)*(x))
#define fi first
#define se second
#define SS stringstream
#define m0(x) memset(x, 0, sizeof x)
#define m1(x) memset(x, -1, sizeof x)
#define minf(x) memset(x, 0x3f3f3f3f, sizeof x);
#define sz(x) (int)x.size()
#define lsone(x) (x&(-x))
#define endl '\n'
typedef long long ll;
typedef pair<int, int> ii;
const int MAX = 1e5+10;
int main(){
	double m[5], w[5];
	int x[5] = {500, 1000, 1500, 2000, 2500};
	for(int i = 0; i < 5; i++)scanf("%lf", &m[i]);
	for(int i = 0; i < 5; i++)scanf("%lf", &w[i]);
	double ans = 0;
	for(int i = 0; i < 5; i++){
		double k = 0.3*x[i];
		double kk = 1.0*(1.0-(m[i]/250.0))*x[i];
		kk-=(50.0*w[i]);
		ans+= max(k, kk);
	}
	int a, b;
	scanf("%d %d", &a, &b);
	ans+= 100*a;
	ans-= 50*b;
	printf("%d\n", (int)ans);
	return 0;
}
// 1449228060524


#include <bits/stdc++.h>

long double _max[] = {500, 1000, 1500, 2000, 2500};

using namespace std;

int main() {
        long double minutes[5];
        long double wrongs[5];
        int h1, h2;
        int output = 0;

        scanf("%Lf %Lf %Lf %Lf %Lf", &minutes[0], &minutes[1], &minutes[2], &minutes[3], &minutes[4]);
        scanf("%Lf %Lf %Lf %Lf %Lf", &wrongs[0], &wrongs[1], &wrongs[2], &wrongs[3], &wrongs[4]);
        scanf("%d %d", &h1, &h2);

        for(int count = 0; count < 5; ++count) {
                output += max(0.3 * _max[count], ((250.0 - minutes[count])/250.0) * _max[count] - 50 * wrongs[count]);
        }

        output += (100 * h1) - (50*h2);

        cout << output << endl;

        return 0;
}
// 1449232075235


/*
    Janderson Angelo - UFAL
*/

#include <bits/stdc++.h>

#define DEBUG 0
#define D(value) if (DEBUG) cout << value << endl;

#define REP(i, a, b) \
    for (int i = int(a); i < int(b); i++) // a to b, and variable i is local!
#define file() \
    freopen("in", "r", stdin);\
    freopen("out", "w", stdout);

using namespace std;

int main()
{
	//file();
	int values[5] = {500, 1000, 1500, 2000, 2500};
    int subm[5];
    REP(i,0,5){
    	cin >> subm[i];
    }
    int wrong[5];
    REP(i,0,5){
    	cin >> wrong[i];
    }
    long double sum = 0;
    REP(i,0,5){
    	long double x = values[i];
    	long double m = subm[i];
    	long double w = wrong[i];
    	long double b1 = 0.3*x;
    	long double b2 = ((1.0-(m/250.0)) * x - (50.0*w));
    	D("b2 = " << b2)
    	double biggest;
    	if(b1 >= b2){
    		biggest = b1;
    	}else{
    		biggest = b2;
    	}
    	sum += biggest;
    	D("problem " << i << " got " << biggest)
    }
    int sus, unsus;
    cin >> sus >> unsus;
    sum += (long double) sus * 100;
    sum -= (long double) unsus * 50;
    cout << (long long int) sum << endl;
}
// 1449231069590


#include <stdio.h>
#include <algorithm>
#include <iostream>

double _max[] = {500.0, 1000.0, 1500.0, 2000.0, 2500.0};
using namespace std;

int main() {
        double min[5];
        double wrg[5];
        int h1, h2;
        int output = 0;

        scanf("%lf%lf%lf%lf%lf", &min[0], &min[1], &min[2], &min[3], &min[4]);
        scanf("%lf%lf%lf%lf%lf", &wrg[0], &wrg[1], &wrg[2], &wrg[3], &wrg[4]);
        scanf("%d%d", &h1, &h2);

        for(int count = 0; count < 5; ++count) {
                output += max(0.3 * _max[count], (1 - min[count]/250.0) * _max[count] - 50.0 * wrg[count]);
        }

        output += (100 * h1) - (50 * h2);

        cout << output << endl;

        return 0;
}
// 1449233698103


/*
    Janderson Angelo - UFAL
*/

#include <bits/stdc++.h>

#define DEBUG 0
#define D(value) if (DEBUG) cout << value << endl;

#define REP(i, a, b) \
    for (int i = int(a); i < int(b); i++) // a to b, and variable i is local!
#define file() \
    freopen("in", "r", stdin);\
    freopen("out", "w", stdout);

using namespace std;

int main()
{
	//file();
	int values[5] = {500, 1000, 1500, 2000, 2500};
    int subm[5];
    REP(i,0,5){
    	cin >> subm[i];
    }
    int wrong[5];
    REP(i,0,5){
    	cin >> wrong[i];
    }
    long long int sum = 0;
    REP(i,0,5){
    	double x = values[i];
    	double m = subm[i];
    	double w = wrong[i];
    	double b1 = 0.3*x;
    	double b2 = ((1.0-(m/250.0)) * x - (50.0*w));
    	D("b2 = " << b2)
    	double biggest;
    	if(b1 >= b2){
    		biggest = b1;
    	}else{
    		biggest = b2;
    	}
    	sum += biggest;
    	D("problem " << i << " got " << biggest)
    }
    int sus, unsus;
    cin >> sus >> unsus;
    sum += sus * 100;
    sum -= unsus * 50;
    cout << sum << endl;
}
// 1449230807000


#include <stdio.h>
#include <algorithm>
#include <iostream>

double _max[] = {500.0, 1000.0, 1500.0, 2000.0, 2500.0};
using namespace std;

int main() {
        double min[5];
        double wrg[5];
        int h1, h2;
        int output = 0;

        scanf("%lf%lf%lf%lf%lf", &min[0], &min[1], &min[2], &min[3], &min[4]);
        scanf("%lf%lf%lf%lf%lf", &wrg[0], &wrg[1], &wrg[2], &wrg[3], &wrg[4]);
        scanf("%d%d", &h1, &h2);

        for(int count = 0; count < 5; ++count) {
                output += max(0.3 * _max[count], ((250.0 - min[count])/250.0) * _max[count] - 50.0 * wrg[count]);
        }

        output += (100 * h1) - (50 * h2);

        cout << output << endl;

        return 0;
}
// 1449234176030


#include<stdio.h>
int main()
{
    int time[10],wa[10],hack_s,hack_u,x[10]={500, 1000, 1500, 2000, 2500};
    double sum;
    //freopen("in.cpp","r",stdin);
    while(scanf("%d",&time[0])!=EOF)
    {
        sum=0;
        for(int i=1;i<5;i++)
            scanf("%d",&time[i]);
        for(int i=0;i<5;i++)
            scanf("%d",&wa[i]);
        scanf("%d%d",&hack_s,&hack_u);
        for(int i=0;i<5;i++)
        {
            double temp=(x[i]-time[i]*x[i]/250.0)-50*wa[i];
            if(temp<0)
                temp=0;
            temp=temp>=0.3*x[i]?temp:0.3*x[i];
            sum+=temp;
            //printf("%.2lf\n",sum);
        }
        sum+=hack_s*100;
        sum-=hack_u*50;
        if(sum<0)
            sum=0;
        printf("%d\n",(int)sum);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int time[10],wa[10],hack_s,hack_u,x[10]={500, 1000, 1500, 2000, 2500};
    int sum;
    //freopen("in.cpp","r",stdin);
    while(scanf("%d",&time[0])!=EOF)
    {
        sum=0;
        for(int i=1;i<5;i++)
            scanf("%d",&time[i]);
        for(int i=0;i<5;i++)
            scanf("%d",&wa[i]);
        scanf("%d%d",&hack_s,&hack_u);
        for(int i=0;i<5;i++)
        {
            int temp=(x[i]-time[i]*(x[i]/250))-50*wa[i];
            if(temp<0)
                temp=0;
            temp=temp>=0.3*x[i]?temp:0.3*x[i];
            sum+=temp;
            //printf("%.2lf\n",sum);
        }
        sum+=hack_s*100;
        sum-=hack_u*50;
        if(sum<0)
            sum=0;
        printf("%d\n",sum);
    }
    return 0;
}


#include<stdio.h>
int main()
{
    int time[10],wa[10],hack_s,hack_u,x[10]={500, 1000, 1500, 2000, 2500};
    double sum;
    //freopen("in.cpp","r",stdin);
    while(scanf("%d",&time[0])!=EOF)
    {
        sum=0;
        for(int i=1;i<5;i++)
            scanf("%d",&time[i]);
        for(int i=0;i<5;i++)
            scanf("%d",&wa[i]);
        scanf("%d%d",&hack_s,&hack_u);
        for(int i=0;i<5;i++)
        {
            double temp=(1-time[i]/250.0)*x[i]-50*wa[i];
            if(temp<0)
                temp=0;
            temp=temp>=0.3*x[i]?temp:0.3*x[i];
            sum+=temp;
            //printf("%.2lf\n",sum);
        }
        sum+=hack_s*100;
        sum-=hack_u*50;
        if(sum<0)
            sum=0;
        printf("%d\n",(int)sum);
    }
    return 0;
}


#include<iostream>
#include <fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define INF 9999999
#define m1 min
#define m2 max
int MIN = INF;
int MAX = -INF;
using namespace std;
struct total
{
	int score[5] = {500,1000,1500,2000,2500};
	double content[5]; int wa[5];
	int sh,ush;
};
int main()
{
	total test;
	for(int i=0; i<5; i++)
	cin>>test.content[i];
	for(int i=0; i<5; i++)
	cin>>test.wa[i];
	cin>>test.sh>>test.ush;
	int ans = 0;
	double com1,com2;
	for(int i=0; i<5; i++)
	{
		com1 = 0.3*test.score[i]; com2 = (1-test.content[i]/250)*test.score[i]-50*test.wa[i];
		ans += m2(com1,com2);
	}
	ans = ans+test.sh*100-test.ush*50;
	cout<<ans<<endl;
//	int a;
//	int wa[5];
//	int score[5] = {500,1000,1500,2000,2500};double content[5];
//	for(int i=0; i<5; i++)
//	cin>>content[i];
//	for(int i=0; i<5; i++)
//	cin>>wa[i];
//	for(int i=0; i<5; i++)
//	cout<<"��"<<i+1<<"��ԭ������:"<<score[i]*0.3<<" ʵ�ʷ���:"<<(1-content[i]/250)*score[i]-50*wa[i]<<endl;
	return 0;
}


//602A_Uncowed Forces(����������)
#include<bits/stdc++.h>
#define m1 min
#define m2 max
using namespace std;
struct total
{
	int score[5] = {500,1000,1500,2000,2500};
	double time[5]; int wa[5];//����ʱ���WA����
	int sh,ush;//hack�ɹ��Ͳ��ɹ�
};
int main()
{
	total test;

	for(int i=0; i<5; i++)
	cin>>test.time[i];

	for(int i=0; i<5; i++)
	cin>>test.wa[i];

	cin>>test.sh>>test.ush;

	double ans = 0;//��
	double com1,com2;
	for(int i=0; i<5; i++)
	{//��һ��time/250������timeҪ����Ϊdouble����
		com1 = 0.3*test.score[i]; com2 = (1-test.time[i]/250)*test.score[i]-50*test.wa[i]; //��ֹ���ʽ
		ans += m2(com1,com2);//m2��max
	}
	ans = ceil(ans);//����floor��ceil���񶼿���
	ans = ans+test.sh*100-test.ush*50;
	cout<<ans<<endl;
	//���²���������
//	int a;
//	int wa[5];
//	int score[5] = {500,1000,1500,2000,2500};double time[5];
//	for(int i=0; i<5; i++)
//	cin>>time[i];
//	for(int i=0; i<5; i++)
//	cin>>wa[i];
//	for(int i=0; i<5; i++)
//	cout<<"��"<<i+1<<"��ԭ������:"<<score[i]*0.3<<" ʵ�ʷ���:"<<(1-time[i]/250)*score[i]-50*wa[i]<<endl;
	return 0;
}


#include<iostream>
#include <fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define INF 9999999
#define m1 min
#define m2 max
int MIN = INF;
int MAX = -INF;
using namespace std;
struct total
{
	int score[5] = {500,1000,1500,2000,2500};
	double content[5]; int wa[5];
	int sh,ush;
};
int main()
{
	total test;
	for(int i=0; i<5; i++)
	cin>>test.content[i];
	for(int i=0; i<5; i++)
	cin>>test.wa[i];
	cin>>test.sh>>test.ush;
	int ans = 0;
	double com1,com2;
	for(int i=0; i<5; i++)
	{
		com1 = 0.3*test.score[i]; com2 = (1-test.content[i]/250)*test.score[i]-50*test.wa[i];
		ans += m2(com1,com2);
	}
	ans = ceil(ans);
	ans = ans+test.sh*100-test.ush*50;
	cout<<ans<<endl;
//	int a;
//	int wa[5];
//	int score[5] = {500,1000,1500,2000,2500};double content[5];
//	for(int i=0; i<5; i++)
//	cin>>content[i];
//	for(int i=0; i<5; i++)
//	cin>>wa[i];
//	for(int i=0; i<5; i++)
//	cout<<"��"<<i+1<<"��ԭ������:"<<score[i]*0.3<<" ʵ�ʷ���:"<<(1-content[i]/250)*score[i]-50*wa[i]<<endl;
	return 0;
}


#include<iostream>
#include <fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define INF 9999999
#define m1 min
#define m2 max
int MIN = INF;
int MAX = -INF;
using namespace std;
struct total
{
	int score[5] = {500,1000,1500,2000,2500};
	double content[5]; int wa[5];
	int sh,ush;
};
int main()
{
	total test;
	for(int i=0; i<5; i++)
	cin>>test.content[i];
	for(int i=0; i<5; i++)
	cin>>test.wa[i];
	cin>>test.sh>>test.ush;
	int ans = 0;
	double com1,com2;
	for(int i=0; i<5; i++)
	{
		com1 = 0.3*test.score[i]; com2 = (1-test.content[i]/250)*test.score[i]-50*test.wa[i];
		ans += m2(com1,com2);
	}
	ans = floor(ans);
	ans = ans+test.sh*100-test.ush*50;
	cout<<ans<<endl;
//	int a;
//	int wa[5];
//	int score[5] = {500,1000,1500,2000,2500};double content[5];
//	for(int i=0; i<5; i++)
//	cin>>content[i];
//	for(int i=0; i<5; i++)
//	cin>>wa[i];
//	for(int i=0; i<5; i++)
//	cout<<"��"<<i+1<<"��ԭ������:"<<score[i]*0.3<<" ʵ�ʷ���:"<<(1-content[i]/250)*score[i]-50*wa[i]<<endl;
	return 0;
}


#include<iostream>
#include <fstream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define INF 9999999
#define m1 min
#define m2 max
int MIN = INF;
int MAX = -INF;
using namespace std;
struct total
{
	int score[5] = {500,1000,1500,2000,2500};
	double content[5]; int wa[5];
	int sh,ush;
};
int main()
{
	total test;
	for(int i=0; i<5; i++)
	cin>>test.content[i];
	for(int i=0; i<5; i++)
	cin>>test.wa[i];
	cin>>test.sh>>test.ush;
	int ans = 0;
	double com1,com2;
	for(int i=0; i<5; i++)
	{
		com1 = 0.3*test.score[i]; com2 = (1-test.content[i]/250)*test.score[i]-50*test.wa[i];
		ans += m2(com1,com2);
	}
	ans = ans+test.sh*100-test.ush*50;
	cout<<ceil(ans)<<endl;
//	int a;
//	int wa[5];
//	int score[5] = {500,1000,1500,2000,2500};double content[5];
//	for(int i=0; i<5; i++)
//	cin>>content[i];
//	for(int i=0; i<5; i++)
//	cin>>wa[i];
//	for(int i=0; i<5; i++)
//	cout<<"��"<<i+1<<"��ԭ������:"<<score[i]*0.3<<" ʵ�ʷ���:"<<(1-content[i]/250)*score[i]-50*wa[i]<<endl;
	return 0;
}


#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#define INF 9999999
#define m1 min
#define m2 max
int MIN = INF;
int MAX = -INF;
using namespace std;
struct total
{
	int score[5] = {500,1000,1500,2000,2500};
	double content[5]; int wa[5];
	int sh,ush;
};
int main()
{
	total test;
	for(int i=0; i<5; i++)
	cin>>test.content[i];
	for(int i=0; i<5; i++)
	cin>>test.wa[i];
	cin>>test.sh>>test.ush;
	int ans = 0;
	int com1,com2;
	for(int i=0; i<5; i++)
	{
		com1 = 0.3*test.score[i]; com2 = (1-test.content[i]/250)*test.score[i]-50*test.wa[i];
		ans += m2(com1,com2);
	}
	ans = ans+test.sh*100-test.ush*50;
	cout<<ans<<endl;
//	int a;
//	int wa[5];
//	int score[5] = {500,1000,1500,2000,2500};double content[5];
//	for(int i=0; i<5; i++)
//	cin>>content[i];
//	for(int i=0; i<5; i++)
//	cin>>wa[i];
//	for(int i=0; i<5; i++)
//	cout<<"��"<<i+1<<"��ԭ������:"<<score[i]*0.3<<" ʵ�ʷ���:"<<(1-content[i]/250)*score[i]-50*wa[i]<<endl;
	return 0;
}


#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<cmath>//头文件
#define For(k,i,j) for(int k=i;k<=j;k++)//for循环
#pragma GCC optimize(4)//O4
using namespace std;
inline int read()
{
    char ch;
    int res=1;
    while((ch=getchar())<'0'||ch>'9') if(ch=='-') res=-1;
    res*=ch-48;
    while((ch=getchar())>='0'&&ch<='9')
        res=res*10+ch-48;
    return res;
}//快读
int m[10],w[10];
int main()
{
    For(i,1,5)
        m[i]=read();
    For(i,1,5)
        w[i]=read();
    int H=read(),IH=read();//输入
    int ans=0;
    For(i,1,5)
        ans+=max((150*i),(250-m[i])*i*2-50*w[i]);//公式（自己推）
    ans+=100*H-50*IH;
    cout<<ans<<endl;
    return 0;
}


#include<bits/stdc++.h>
#define read(x) 	scanf("%lf",&x);
#define write(x)	printf("%d ",x);
#define clear(a)	memset(a,0,sizeof(a));
using namespace std;
const int INF = 1 << 31 - 1;
const int N = 2e5 + 7;
int n, m, x;
char s[N], last;
struct Node
{
	double x;
	double m, w;
}a[6];

inline double max(double c, double d)
{
	return c > d ? c : d;
}
int main()
{
	double h1, h2;
	for(int i = 1; i <= 5; i++)
	{
		a[i].x = i * 500;
		read(a[i].m);
	}
	for(int i = 1; i <= 5; i++)	read(a[i].w);
	read(h1); read(h2);
	double sum = 100.00 * h1 - 50.00 * h2;
	for(int i = 1; i <= 5; i++)
	{
		double m = a[i].m; double w = a[i].w; double  x = a[i].x;
		sum += max(x * 0.30 ,double(double(1 - m/250) * x - 50.00 * w));
	}
	write(int(sum+0.500));
	return 0;
}


#include<bits/stdc++.h>

using namespace std;

double calc(int m, int w, int value) {
  double a = 0.3 * value;
  double b = (1 - m/250.0) * value - (50 * w);
  return max(a, b);
}

int main() {
  vector<int> m(5);
  vector<int> score = {500, 1000, 1500, 2000, 2500};
  vector<int> w(5);
  int gh, bh;
  //double out = 0.0;
  int out = 0;
  for(int i = 0; i < 5; i++)
    cin >> m[i];
  for(int i = 0; i < 5; i++)
    cin >> w[i];
  cin >> gh >> bh;
  for(int i = 0; i < 5; i++) {
    out += calc(m[i], w[i], score[i]);
  }
  out += gh * 100;
  out -= bh * 50;
  out = max(0, out);
  cout << int(out) << endl;
  return 0;
}


#include<bits/stdc++.h>

using namespace std;

double calc(int m, int w, int value) {
  double a = 0.3 * value;
  double b = (value - (value*m)/250) - (50 * w);
  return max(a, b);
}

int main() {
  vector<int> m(5);
  vector<int> score = {500, 1000, 1500, 2000, 2500};
  vector<int> w(5);
  int gh, bh;
  //double out = 0.0;
  int out = 0;
  for(int i = 0; i < 5; i++)
    cin >> m[i];
  for(int i = 0; i < 5; i++)
    cin >> w[i];
  cin >> gh >> bh;
  for(int i = 0; i < 5; i++) {
    out += calc(m[i], w[i], score[i]);
  }
  out += gh * 100;
  out -= bh * 50;
  //out = max(0, out);
  cout << int(out) << endl;
  return 0;
}


#include<bits/stdc++.h>

using namespace std;

double calc(int m, int w, int value) {
  double a = 0.3 * value;
  double b = ((250 - m)/250.0) * value - (50 * w);
  return max(a, b);
}

int main() {
  vector<int> m(5);
  vector<int> score = {500, 1000, 1500, 2000, 2500};
  vector<int> w(5);
  int gh, bh;
  //double out = 0.0;
  int out = 0;
  for(int i = 0; i < 5; i++)
    cin >> m[i];
  for(int i = 0; i < 5; i++)
    cin >> w[i];
  cin >> gh >> bh;
  for(int i = 0; i < 5; i++) {
    out += calc(m[i], w[i], score[i]);
  }
  out += gh * 100;
  out -= bh * 50;
  //out = max(0, out);
  cout << int(out) << endl;
  return 0;
}


#include<bits/stdc++.h>

using namespace std;

int calc(int m, int w, int value) {
  int a = 150 * value;
  int b = (500 - (2*m)) * (value) - (50 * w);
  return max(a, b);
}

int main() {
  vector<int> m(5);
  vector<int> w(5);
  int gh, bh;
  //double out = 0.0;
  int out = 0;
  for(int i = 0; i < 5; i++)
    cin >> m[i];
  for(int i = 0; i < 5; i++)
    cin >> w[i];
  cin >> gh >> bh;
  for(int i = 0; i < 5; i++) {
    out += calc(m[i], w[i], i + 1);
  }
  out += gh * 100;
  out -= bh * 50;
  out = max(0, out);
  cout << int(out) << endl;
  return 0;
}


#include<bits/stdc++.h>

using namespace std;

double calc(int m, int w, int value) {
  double a = 0.3 * value;
  double b = (1 - m/250.0) * value - (50 * w);
  return max(a, b);
}

int main() {
  vector<int> m(5);
  vector<int> score = {500, 1000, 1500, 2000, 2500};
  vector<int> w(5);
  int gh, bh;
  double out = 0.0;
  for(int i = 0; i < 5; i++)
    cin >> m[i];
  for(int i = 0; i < 5; i++)
    cin >> w[i];
  cin >> gh >> bh;
  for(int i = 0; i < 5; i++) {
    out += calc(m[i], w[i], score[i]);
  }
  out += gh * 100;
  out -= bh * 50;
  out = max(0.0, out);
  cout << int(out) << endl;
  return 0;
}


#include <iostream>

using namespace std;

int main(){
    double m[5];
    double w[5];
    for(int i = 0; i < 5; i++){
        cin>>m[i];
    }
    for(int i = 0; i < 5; i++){
        cin>>w[i];
    }
    int hs, hw;
    cin>>hs>>hw;
    int res = hs*100 - hw*50;
    for(int i = 0; i < 5; i++){
        double first = 0.3* (i+1)*500.0;
        double second = (1 - m[i]/250)*(i+1)*500.0 - 50*w[i];
        if(first > second){
            res += first;
        }   else    {
            res+=  second;
        }
    }
    cout<<res;
    return 0;
}


#include <iostream>
#include <math.h>

using namespace std;

int main(){
    double m[5];
    double w[5];
    for(int i = 0; i < 5; i++){
        cin>>m[i];
    }
    for(int i = 0; i < 5; i++){
        cin>>w[i];
    }
    int hs, hw;
    cin>>hs>>hw;
    double res = hs*100 - hw*50;
    for(int i = 0; i < 5; i++){
        double first = (i+1)*500*0.3 ;
        double second = ((i+1)*500 - m[i]*2*(i+1)) - 50*w[i];
        res+=max(first, second);
    }
    cout<< res;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    double m[5];
    double w[5];
    for(int i = 0; i < 5; i++){
        cin>>m[i];
    }
    for(int i = 0; i < 5; i++){
        cin>>w[i];
    }
    int hs, hw;
    cin>>hs>>hw;
    int res = hs*100 - hw*50;
    for(int i = 0; i < 5; i++){
        double first = (i+1)*500*0.3 ;
        double second = ((i+1)*500 - m[i]*2*(i+1)) - 50*w[i];
        if(first > second){
            res += first;
        }   else    {
            res+=  second;
        }
    }
    if(res<0) cout<<0;
    else cout<< res;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    double m[5];
    double w[5];
    for(int i = 0; i < 5; i++){
        cin>>m[i];
    }
    for(int i = 0; i < 5; i++){
        cin>>w[i];
    }
    int hs, hw;
    cin>>hs>>hw;
    int res = hs*100 - hw*50;
    for(int i = 0; i < 5; i++){
        double first = (i+1)*500*0.3 ;
        double second = (i+1)*500*(1 - m[i]/250) - 50*w[i];
        if(first > second){
            res += first;
        }   else    {
            res+=  second;
        }
    }
    cout<< res;
    return 0;
}


#include <iostream>

using namespace std;

int main(){
    double m[5];
    double w[5];
    for(int i = 0; i < 5; i++){
        cin>>m[i];
    }
    for(int i = 0; i < 5; i++){
        cin>>w[i];
    }
    int hs, hw;
    cin>>hs>>hw;
    int res = hs*100 - hw*50;
    for(int i = 0; i < 5; i++){
        double first = (i+1)*500*0.3 ;
        double second = ((i+1)*500 - m[i]*2*(i+1)) - 50*w[i];
        if(first > second){
            res += first;
        }   else    {
            res+=  second;
        }
    }
    cout<< res;
    return 0;
}


#include<algorithm>
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#include<deque>
#include<climits>
#include<complex>

using namespace std;
//-------------------------------------

#define ll long long
#define sc(x) scanf("%lld",&x)
#define sc2(x,y) scanf("%lld%lld",&x,&y)
#define sci(x) scanf("%d",&x)
#define sci2(x,y) scanf("%d%d",&x,&y)

#define mem(x) memset(x,0,sizeof x)
#define all(x) x.begin(),x.end()
#define pb(x)  push_back(x);
#define xx first
#define yy second
#define inf 999999999999999
#define mkp(x,y) make_pair(x,y)
#define pii pair<ll,ll>

//---------------------------------------

#define MX 100007
#define pi 2*acos(0.00)

#define open       freopen("input.txt","r",stdin)
#define close      freopen ("output.txt","w",stdout)

int main()
{
    ll i, j, l, u, v, y, z, a, b, c, d, e, f, t = 1, tc;
    ll flg, sz, cnt, ans, mx, mn;
    ll k, n;
    ll pont[10] = {500, 1000, 1500, 2000, 2500};
    ll inp[10], tm[10];
    for(i = 0; i < 5; i++) cin >> inp[i];
    for(i = 0; i < 5; i++) cin >> tm[i];
    cin >> a >> b;
    ll tl = 0 ;
    double x, gt, w, m;
    double sm = 0.00, a1, a2, a3;
    for(i = 0; i < 5; i++)
    {
        x = pont[i];
        w = tm[i];
        m = inp[i];
//        gt = max((0.3 * x), ((1.00 - m / 250.00) * x - 50.00 * w));
//        cout<<gt<<" ";
        a1 = double(250.00 - m) / 250.00;
        a1 *= x;
        a1 -= double(50.00 * w);
        a1 = max(0.3 * x, a1);
        gt = a1;
//        cout<<a1<<endl;;
        sm += double(gt);
    }
    sm = sm + (a * 100 - b * 50);
    printf("%.0lf",sm);
    //a = sm;
    //cout << sm<< endl;
    return 0;
}

/*

*/


#include<algorithm>
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#include<deque>
#include<climits>
#include<complex>

using namespace std;
//-------------------------------------

#define ll long long
#define sc(x) scanf("%lld",&x)
#define sc2(x,y) scanf("%lld%lld",&x,&y)
#define sci(x) scanf("%d",&x)
#define sci2(x,y) scanf("%d%d",&x,&y)

#define mem(x) memset(x,0,sizeof x)
#define all(x) x.begin(),x.end()
#define pb(x)  push_back(x);
#define xx first
#define yy second
#define inf 999999999999999
#define mkp(x,y) make_pair(x,y)
#define pii pair<ll,ll>

//---------------------------------------

#define MX 100007
#define pi 2*acos(0.00)

#define open       freopen("input.txt","r",stdin)
#define close      freopen ("output.txt","w",stdout)

int main()
{
    ll i, j, l, u, v, w, x, y, z, a, b, c, d, e, f, t = 1, tc;
    ll flg, sz, cnt, ans, mx, mn;
    ll m, k,n;
    ll pont[10] = {500, 1000, 1500, 2000, 2500};
    ll inp[10], tm[10];
    double sm=00.00,gt,aa,a1;

    for(i = 0; i < 5; i++) cin >> inp[i];
    for(i = 0; i < 5; i++) cin >> tm[i];
    cin >> a >> b;

    for(i=0;i<5;i++)
    {
        m = double(inp[i]);
        w = double(tm[i]);
        x = double(pont[i]);
        aa = double(x*.3);

//        a1 = double((250.00*x-m*x) - 250.00*w*50.00);
        a1 = double(250*x - m*x);
        a1 = double(a1/250.00);
        a1-=(50.00*w);
        sm+= double(max(aa,a1));
    }
    sm = sm+(a*100-b*50);
//    u = (sm);
//    cout<<u<<endl;
    printf("%.0lf",sm);

    return 0;
}

/*

*/


#include<algorithm>
#include<cstdio>
#include<sstream>
#include<cstdlib>
#include<cctype>
#include<cmath>
#include<set>
#include<queue>
#include<stack>
#include<list>
#include<iostream>
#include<fstream>
#include<numeric>
#include<string>
#include<vector>
#include<cstring>
#include<map>
#include<iterator>
#include<deque>
#include<climits>
#include<complex>

using namespace std;
//-------------------------------------

#define ll long long
#define sc(x) scanf("%lld",&x)
#define sc2(x,y) scanf("%lld%lld",&x,&y)
#define sci(x) scanf("%d",&x)
#define sci2(x,y) scanf("%d%d",&x,&y)

#define mem(x) memset(x,0,sizeof x)
#define all(x) x.begin(),x.end()
#define pb(x)  push_back(x);
#define xx first
#define yy second
#define inf 999999999999999
#define mkp(x,y) make_pair(x,y)
#define pii pair<ll,ll>

//---------------------------------------

#define MX 100007
#define pi 2*acos(0.00)

#define open       freopen("input.txt","r",stdin)
#define close      freopen ("output.txt","w",stdout)

int main()
{
    ll i, j, l, u, v, w, x, y, z, a, b, c, d, e, f, t = 1, tc;
    ll flg, sz, cnt, ans, mx, mn;
    ll m, k,n;
    ll pont[10] = {500, 1000, 1500, 2000, 2500};
    ll inp[10], tm[10];
    double sm=00.00,gt,aa,a1;

    for(i = 0; i < 5; i++) cin >> inp[i];
    for(i = 0; i < 5; i++) cin >> tm[i];
    cin >> a >> b;

    for(i=0;i<5;i++)
    {
        m = inp[i];
        w = tm[i];
        x = pont[i];
        aa = double(pont[i]*.3);
        a1 = double((250.00*x-m*x) - 250.00*w*50.00);
        a1 = double(a1/250.00);
        sm+= double(max(aa,a1));
    }
    sm = sm+(a*100-b*50);
    u = sm;
    cout<<u<<endl;

    return 0;
}

/*

*/