import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class SagheerAndNubianMarket {
    InputStream is;
    PrintWriter pw;
    String INPUT = "";
    long L_INF = (1L << 60L);

    void solve() {
        int n = ni(), s = ni(), m;
        int a[] = na(n);
        int l = 0, r = n+1;
        while (l < r-1) {
            m = (l + r) >> 1;
            long val = calc(a, m, s);
            if (val <= s)
                l = m;
            else
                r = m;
        }
        pw.println(l + " " + calc(a, l, s));
    }

    private long calc(int[] a, int m, int s) {
        int n = a.length, idx = 1;
        long c[] = new long[n];
        for (int i = 0; i < n; i++) {
            c[i] = a[i] + (i + 1L) * m;
        }
        Arrays.sort(c, 1, n);
        long sum = 0;
        for (int i = 0; i < m; i++) {
            sum += c[i];
        }
        return sum;
    }

    void run() throws Exception {
//		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        is = System.in;
        pw = new PrintWriter(System.out);

        long s = System.currentTimeMillis();
//        int t = ni();
//        while (t-- > 0)
        solve();
        pw.flush();
        tr(System.currentTimeMillis() - s + "ms");
    }

    public static void main(String[] args) throws Exception {
        new SagheerAndNubianMarket().run();
    }

    private byte[] inbuf = new byte[1024];
    private int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b)) ;
        return b;
    }

    private double nd() {
        return Double.parseDouble(ns());
    }

    private char nc() {
        return (char) skip();
    }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for (int i = 0; i < n; i++) map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-')) ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

    private void tr(Object... o) {
        if (!oj) System.out.println(Arrays.deepToString(o));
    }
}


//package Practice_Problems;
import java.util.*;
import java.io.*;
public class interesting_bs
{
	static long sum=0;
	static final int mod=(int)1e9+7;
	static final int inf=(int)1e9;
	static final long INF=(long)1e18;
	public static void main(String[] args)
	{
		FastScanner fs=new FastScanner();
		int n=fs.nextInt();
		int s=fs.nextInt();
		int arr[]=fs.readArray(n);
		long left=0,right=n;
		long ans=INF,second=0;
		while(left<=right)
		{
			long mid=left+(right-left)/2;
			if(isValid(mid,arr,s,fs))
			{
				ans=mid;second=sum;
				left=mid+1;
			}
			else
				right=mid-1;
		}
		System.out.println(ans+" "+second);
	}
	public static boolean isValid(long mid,int arr[],int s,FastScanner fs)
	{
		sum=0;
		if(mid==0)return true;
		long needed[]=new long[arr.length];
		for(int i=0;i<arr.length;i++)
		{
			needed[i]=(i+1)*mid;
			needed[i]+=arr[i];
		}
		fs.longsort(needed);
		for(int i=0;i<=arr.length-mid;i++)
		{
			long sum1=0;
			for(int j=i;j<=i+mid-1;j++)
			{
				sum1+=needed[j];
			}
			if(sum1<=s)
			{sum=sum1;return true;}
		}
		return false;
	}
}
class FastScanner
{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next()
		{
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}
		int[] sort(int arr[])
		{
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		char[] charsort(char arr[])
	        {
	    	ArrayList<Character> list = new ArrayList<>();
	    	for(char c:arr)list.add(c);
	    	Collections.sort(list);
	    	for(int i=0;i<list.size();i++)
	    	{
	    		arr[i]=list.get(i);
	    	}
	    	return arr;
	        }
		long[] longsort(long arr[])
		{
			ArrayList<Long> list = new ArrayList<Long>();
			for(long i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		public int[] readArray(int n)
		{
			int[] arr=new int[n];
			for (int i=0; i<n; i++) arr[i]=nextInt();
			return arr;
		}
		public long nextLong()
		{
			return Long.parseLong(next());
		}
		public long[] longreadArray(int n)
		{
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
}


//package Practice_Problems;
import java.util.*;
import java.io.*;
public class interesting_bs
{
	static long sum=0;
	static final int mod=(int)1e9+7;
	static final int inf=(int)1e9;
	static final long INF=(long)1e18;
	public static void main(String[] args)
	{
		FastScanner fs=new FastScanner();
		int n=fs.nextInt();
		int s=fs.nextInt();
		int arr[]=fs.readArray(n);
		int left=0,right=n;
		long first=INF,second=0;
		while(left<=right)
		{
			int mid=left+(right-left)/2;
			if(isValid(mid,arr,s,fs))
			{
				first=mid;second=sum;
				left=mid+1;
			}
			else
				right=mid-1;
		}
		System.out.println(first+" "+second);
	}
	public static boolean isValid(int mid,int arr[],int s,FastScanner fs)
	{
		sum=0;
		if(mid==0)return true;
		long needed[]=new long[arr.length];
		for(int i=0;i<arr.length;i++)
		{
			needed[i]=(i+1)*mid;
			needed[i]+=arr[i];
		}
		fs.longsort(needed);
		for(int i=0;i<=arr.length-mid;i++)
		{
			long sum1=0;
			for(int j=i;j<=i+mid-1;j++)
			{
				sum1+=needed[j];
			}
			if(sum1<=s)
			{sum=sum1;return true;}
		}
		return false;
	}
}
class FastScanner
{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next()
		{
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}
		int[] sort(int arr[])
		{
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		char[] charsort(char arr[])
	        {
	    	ArrayList<Character> list = new ArrayList<>();
	    	for(char c:arr)list.add(c);
	    	Collections.sort(list);
	    	for(int i=0;i<list.size();i++)
	    	{
	    		arr[i]=list.get(i);
	    	}
	    	return arr;
	        }
		long[] longsort(long arr[])
		{
			ArrayList<Long> list = new ArrayList<Long>();
			for(long i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		public int[] readArray(int n)
		{
			int[] arr=new int[n];
			for (int i=0; i<n; i++) arr[i]=nextInt();
			return arr;
		}
		public long nextLong()
		{
			return Long.parseLong(next());
		}
		public long[] longreadArray(int n)
		{
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
}


//package Practice_Problems;
import java.util.*;
import java.io.*;
public class interesting_bs
{
	static long sum=0;
	static final int mod=(int)1e9+7;
	static final int inf=(int)1e9;
	static final long INF=(long)1e18;
	public static void main(String[] args)
	{
		FastScanner fs=new FastScanner();
		int n=fs.nextInt();
		int s=fs.nextInt();
		int arr[]=fs.readArray(n);
		long left=0,right=n;
		long first=INF,second=0;
		while(left<=right)
		{
			long mid=left+(right-left)/2;
			if(isValid(mid,arr,s,fs))
			{
				first=mid;second=sum;
				left=mid+1;
			}
			else
				right=mid-1;
		}
		System.out.println(first+" "+second);
	}
	public static boolean isValid(long mid,int arr[],int s,FastScanner fs)
	{
		sum=0;
		if(mid==0)return true;
		long needed[]=new long[arr.length];
		long pref[]=new long[arr.length];
		for(int i=0;i<arr.length;i++)
		{
			needed[i]=(i+1)*mid;
			needed[i]+=arr[i];
		}
		fs.longsort(needed);
		for(int i=0;i<arr.length;i++)
		{
			if(i==0)pref[i]=needed[i];
			else pref[i]=pref[i-1]+needed[i];
		}
		for(int i=0;i<=arr.length-mid;i++)
		{
			if(i==0)
			{
				if(pref[(int)(i+mid-1)]<=s) {sum=pref[(int)(i+mid-1)];return true;}
			}
			else
			{
				if(pref[(int)(i+mid-1)]-pref[i-1]<=s) {sum=pref[(int)(i+mid-1)]-pref[i-1];return true;}
			}
		}
		return false;
	}
}
class FastScanner
{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next()
		{
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}
		int[] sort(int arr[])
		{
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		char[] charsort(char arr[])
	        {
	    	ArrayList<Character> list = new ArrayList<>();
	    	for(char c:arr)list.add(c);
	    	Collections.sort(list);
	    	for(int i=0;i<list.size();i++)
	    	{
	    		arr[i]=list.get(i);
	    	}
	    	return arr;
	        }
		long[] longsort(long arr[])
		{
			ArrayList<Long> list = new ArrayList<Long>();
			for(long i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		public int[] readArray(int n)
		{
			int[] arr=new int[n];
			for (int i=0; i<n; i++) arr[i]=nextInt();
			return arr;
		}
		public long nextLong()
		{
			return Long.parseLong(next());
		}
		public long[] longreadArray(int n)
		{
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
}


//package Practice_Problems;
import java.util.*;
import java.io.*;
public class interesting_bs
{
	static long sum=0;
	static final int mod=(int)1e9+7;
	static final int inf=(int)1e9;
	static final long INF=(long)1e18;
	public static void main(String[] args)
	{
		FastScanner fs=new FastScanner();
		int n=fs.nextInt();
		int s=fs.nextInt();
		int arr[]=fs.readArray(n);
		long left=0,right=n;
		long first=INF,second=0;
		while(left<=right)//log(N)
		{
			long mid=left+(right-left)/2;
			if(isValid(mid,arr,s,fs))
			{
				first=mid;second=sum;
				left=mid+1;
			}
			else
				right=mid-1;
		}
		//TOTAL COMPLEXITY --> O(NLOG(N)*LOG(N))--> O(NLOG^2(N)).
		System.out.println(first+" "+second);
	}
	public static boolean isValid(long mid,int arr[],int s,FastScanner fs)
	{
		sum=0;
		if(mid==0)return true;
		//PREFIX SUMS TECHINQUE.COMPLEXITY REMAINS SAME IN BOTH CASES.
//		long needed[]=new long[arr.length];
//		long pref[]=new long[arr.length];
//		for(int i=0;i<arr.length;i++)//O(N)
//		{
//			needed[i]=(i+1)*mid;
//			needed[i]+=arr[i];
//		}
//		fs.longsort(needed);//(NLOG(N))
//		for(int i=0;i<arr.length;i++)//O(N)
//		{
//			if(i==0)pref[i]=needed[i];
//			else pref[i]=pref[i-1]+needed[i];
//		}
//		for(int i=0;i<=arr.length-mid;i++)//O(N)
//		{
//			if(i==0)
//			{
//				if(pref[(int)(i+mid-1)]<=s) {sum=pref[(int)(i+mid-1)];return true;}
//			}
//			else
//			{
//				if(pref[(int)(i+mid-1)]-pref[i-1]<=s) {sum=pref[(int)(i+mid-1)]-pref[i-1];return true;}
//			}
//		}
        //SLIDING WINDOW TECHNIQUE.
		long needed[]=new long[arr.length];
		long slide[]=new long[arr.length];
		for(int i=0;i<=arr.length-1;i++)
		{
			needed[i]=((i+1)*mid)+arr[i];
		}
		fs.longsort(needed);
		for(int i=0;i<=mid-1;i++)
		{
			slide[i]=i==0 ? needed[i]:slide[i-1]+needed[i];
		}
		if(slide[(int)(mid-1)]<=s) {sum=slide[(int)(mid-1)];return true;}
		for(int i=(int)(mid+1);i<=arr.length-1;i++)
		{
		   long ans=slide[i-1]+needed[i]-slide[(int)(i-mid+1)];
		   if(ans<=s) {sum=ans;return true;}
		}
		// T(N)= 3N+NLOG(N) --> O(NLOG(N)).
		return false;
	}
}
class FastScanner
{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next()
		{
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}
		int[] sort(int arr[])
		{
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		char[] charsort(char arr[])
	        {
	    	ArrayList<Character> list = new ArrayList<>();
	    	for(char c:arr)list.add(c);
	    	Collections.sort(list);
	    	for(int i=0;i<list.size();i++)
	    	{
	    		arr[i]=list.get(i);
	    	}
	    	return arr;
	        }
		long[] longsort(long arr[])
		{
			ArrayList<Long> list = new ArrayList<Long>();
			for(long i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		public int[] readArray(int n)
		{
			int[] arr=new int[n];
			for (int i=0; i<n; i++) arr[i]=nextInt();
			return arr;
		}
		public long nextLong()
		{
			return Long.parseLong(next());
		}
		public long[] longreadArray(int n)
		{
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
}


//package Practice_Problems;
import java.util.*;
import java.io.*;
public class interesting_bs
{
	static long sum=0;
	static final int mod=(int)1e9+7;
	static final int inf=(int)1e9;
	static final long INF=(long)1e18;
	public static void main(String[] args)
	{
		FastScanner fs=new FastScanner();
		int n=fs.nextInt();
		int s=fs.nextInt();
		int arr[]=fs.readArray(n);
		long left=0,right=n;
		long first=INF,second=0;
		while(left<=right)//log(N)
		{
			long mid=left+(right-left)/2;
			if(isValid(mid,arr,s,fs))
			{
				first=mid;second=sum;
				left=mid+1;
			}
			else
				right=mid-1;
		}
		//TOTAL COMPLEXITY --> O(NLOG(N)*LOG(N))--> O(NLOG^2(N)).
		System.out.println(first+" "+second);
	}
	public static boolean isValid(long mid,int arr[],int s,FastScanner fs)
	{
		sum=0;
		if(mid==0)return true;
		long needed[]=new long[arr.length];
		long pref[]=new long[arr.length];
		for(int i=0;i<arr.length;i++)//O(N)
		{
			needed[i]=(i+1)*mid;
			needed[i]+=arr[i];
		}
		fs.longsort(needed);//(NLOG(N))
		for(int i=0;i<arr.length;i++)//O(N)
		{
			if(i==0)pref[i]=needed[i];
			else pref[i]=pref[i-1]+needed[i];
		}
		for(int i=0;i<=arr.length-mid;i++)//O(N)
		{
			if(i==0)
			{
				if(pref[(int)(i+mid-1)]<=s) {sum=pref[(int)(i+mid-1)];return true;}
			}
			else
			{
				if(pref[(int)(i+mid-1)]-pref[i-1]<=s) {sum=pref[(int)(i+mid-1)]-pref[i-1];return true;}
			}
		}
		return false;
	}
}
class FastScanner
{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next()
		{
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}
		int[] sort(int arr[])
		{
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		char[] charsort(char arr[])
	        {
	    	ArrayList<Character> list = new ArrayList<>();
	    	for(char c:arr)list.add(c);
	    	Collections.sort(list);
	    	for(int i=0;i<list.size();i++)
	    	{
	    		arr[i]=list.get(i);
	    	}
	    	return arr;
	        }
		long[] longsort(long arr[])
		{
			ArrayList<Long> list = new ArrayList<Long>();
			for(long i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		public int[] readArray(int n)
		{
			int[] arr=new int[n];
			for (int i=0; i<n; i++) arr[i]=nextInt();
			return arr;
		}
		public long nextLong()
		{
			return Long.parseLong(next());
		}
		public long[] longreadArray(int n)
		{
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
}


//package Practice_Problems;
import java.util.*;
import java.io.*;
public class interesting_bs
{
	static int sum=0;
	static final int mod=(int)1e9+7;
	static final int inf=(int)1e9;
	static final long INF=(long)1e18;
	public static void main(String[] args)
	{
		FastScanner fs=new FastScanner();
		int n=fs.nextInt();
		int s=fs.nextInt();
		int arr[]=fs.readArray(n);
		int left=0,right=n;
		int first=inf,second=0;
		while(left<=right)
		{
			int mid=left+(right-left)/2;
			if(isValid(mid,arr,s))
			{
				first=mid;second=sum;
				left=mid+1;
			}
			else
				right=mid-1;
		}
		System.out.println(first+" "+second);
	}
	public static boolean isValid(int mid,int arr[],int s)
	{
		sum=0;
		if(mid==0)return true;
		int cnt=0;
		for(int i=0;i<arr.length;i++)
		{
			int needed=(i+1)*mid;
			if(sum+arr[i]+needed<=s)
			{
				sum=sum+arr[i]+needed;
				cnt++;
			}
		}
		if(cnt>=mid)return true;
		else return false;
	}
}
class FastScanner
{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next()
		{
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}
		int[] sort(int arr[])
		{
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		char[] charsort(char arr[])
	        {
	    	ArrayList<Character> list = new ArrayList<>();
	    	for(char c:arr)list.add(c);
	    	Collections.sort(list);
	    	for(int i=0;i<list.size();i++)
	    	{
	    		arr[i]=list.get(i);
	    	}
	    	return arr;
	        }
		long[] longsort(long arr[])
		{
			ArrayList<Long> list = new ArrayList<Long>();
			for(long i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		public int[] readArray(int n)
		{
			int[] arr=new int[n];
			for (int i=0; i<n; i++) arr[i]=nextInt();
			return arr;
		}
		public long nextLong()
		{
			return Long.parseLong(next());
		}
		public long[] longreadArray(int n)
		{
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
}


//package Practice_Problems;
import java.util.*;
import java.io.*;
public class interesting_bs
{
	static long sum=0;
	static final int mod=(int)1e9+7;
	static final int inf=(int)1e9;
	static final long INF=(long)1e18;
	public static void main(String[] args)
	{
		FastScanner fs=new FastScanner();
		int n=fs.nextInt();
		int s=fs.nextInt();
		int arr[]=fs.readArray(n);
		long left=0,right=n;
		long first=INF,second=0;
		while(left<=right)
		{
			long mid=left+(right-left)/2;
			if(isValid(mid,arr,s,fs))
			{
				first=mid;second=sum;
				left=mid+1;
			}
			else
				right=mid-1;
		}
		System.out.println(first+" "+second);
	}
	public static boolean isValid(long mid,int arr[],int s,FastScanner fs)
	{
		sum=0;
		if(mid==0)return true;
		long needed[]=new long[arr.length];
		for(int i=0;i<arr.length;i++)
		{
			needed[i]=(i+1)*mid;
			needed[i]+=arr[i];
		}
		fs.longsort(needed);
		for(int i=0;i<=arr.length-mid;i++)
		{
			long sum1=0;
			for(int j=i;j<=i+mid-1;j++)
			{
				sum1+=needed[j];
			}
			if(sum1<=s)
			{sum=sum1;return true;}
		}
		return false;
	}
}
class FastScanner
{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next()
		{
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}
		int[] sort(int arr[])
		{
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		char[] charsort(char arr[])
	        {
	    	ArrayList<Character> list = new ArrayList<>();
	    	for(char c:arr)list.add(c);
	    	Collections.sort(list);
	    	for(int i=0;i<list.size();i++)
	    	{
	    		arr[i]=list.get(i);
	    	}
	    	return arr;
	        }
		long[] longsort(long arr[])
		{
			ArrayList<Long> list = new ArrayList<Long>();
			for(long i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		public int[] readArray(int n)
		{
			int[] arr=new int[n];
			for (int i=0; i<n; i++) arr[i]=nextInt();
			return arr;
		}
		public long nextLong()
		{
			return Long.parseLong(next());
		}
		public long[] longreadArray(int n)
		{
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
}


//package Practice_Problems;
import java.util.*;
import java.io.*;
public class interesting_bs
{
	static long sum=0;
	static final int mod=(int)1e9+7;
	static final int inf=(int)1e9;
	static final long INF=(long)1e18;
	public static void main(String[] args)
	{
		FastScanner fs=new FastScanner();
		int n=fs.nextInt();
		int s=fs.nextInt();
		int arr[]=fs.readArray(n);
		int left=0,right=n;
		long first=INF,second=0;
		while(left<=right)
		{
			int mid=left+(right-left)/2;
			if(isValid(mid,arr,s,fs))
			{
				first=mid;second=sum;
				left=mid+1;
			}
			else
				right=mid-1;
		}
		System.out.println(first+" "+second);
	}
	public static boolean isValid(int mid,int arr[],int s,FastScanner fs)
	{
		sum=0;
		if(mid==0)return true;
		long needed[]=new long[arr.length];
		for(int i=0;i<arr.length;i++)
		{
			needed[i]=(i+1)*(mid);
			needed[i]+=arr[i];
		}
		if(s==(int)1e9)System.out.println(Arrays.toString(needed));
		fs.longsort(needed);
		for(int i=0;i<=arr.length-mid;i++)
		{
			long sum1=0;
			for(int j=i;j<=i+mid-1;j++)
			{
				sum1=sum+needed[j];
			}
			if(sum1<=s)
			{sum=sum1;return true;}
		}
		return false;
	}
}
class FastScanner
{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		public String next()
		{
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();

		}
		int[] sort(int arr[])
		{
			ArrayList<Integer> list = new ArrayList<Integer>();
			for(int i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		char[] charsort(char arr[])
	        {
	    	ArrayList<Character> list = new ArrayList<>();
	    	for(char c:arr)list.add(c);
	    	Collections.sort(list);
	    	for(int i=0;i<list.size();i++)
	    	{
	    		arr[i]=list.get(i);
	    	}
	    	return arr;
	        }
		long[] longsort(long arr[])
		{
			ArrayList<Long> list = new ArrayList<Long>();
			for(long i:arr)list.add(i);
			Collections.sort(list);
			for(int i=0;i<arr.length;i++)
			{
				arr[i]=list.get(i);
			}
			return arr;
		}
		public int nextInt()
		{
			return Integer.parseInt(next());
		}
		public int[] readArray(int n)
		{
			int[] arr=new int[n];
			for (int i=0; i<n; i++) arr[i]=nextInt();
			return arr;
		}
		public long nextLong()
		{
			return Long.parseLong(next());
		}
		public long[] longreadArray(int n)
		{
			long[] a=new long[n];
			for (int i=0; i<n; i++) a[i]=nextLong();
			return a;
		}
}


import java.io.*;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException, InterruptedException {

		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		int n = sc.nextInt();
		long s = sc.nextLong();  //budget

		long arr[] = new long[n];
		for(int i= 0; i<n; i++) {
			arr[i] = sc.nextLong();
		}

		long lo = 0;
		long hi = n;

		long number = 0;
		long total = 0;

		while(lo  <=  hi) {
			long mid = (lo + hi)/2;

			long curr = 0;
			long sum = 0;

			PriorityQueue<Long> pq = new PriorityQueue<Long>();
			for(int i = 0; i< n; i++) {
				pq.add( (arr[i] + (i+1)* (mid+1)));
			}

			for(int i = 0; i<n; i++) {

				if(i > mid)
					break;

				curr++;
				sum += pq.poll();
			}

			if(sum > s) {
				hi = mid-1;
			}
			else {
				if(curr > number) {
					number = curr;
					total = sum;
				}

				lo = mid+1;
			}

		}

		pw.println(number +" " + total);

		pw.flush();
		pw.close();

	}

	public static int lower(int[] arr, int x) {
		int ans = -1;
		int lo = 0;
		int hi = arr.length - 1;

		while(lo <= hi) {
			int mid = (lo + hi)/2;

			if (arr[mid] < x) {
				lo = mid+1;
			} else {
				if(arr[mid] == x)
					ans = mid;
				hi = mid-1;

			}

		}

		return ans;
	}

	public static int higher(int[] arr, int x) {
		int ans = -1;
		int lo = 0;
		int hi = arr.length - 1;

		while(lo <= hi) {
			int mid = (lo + hi)/2;

			if (arr[mid] <= x) {

				lo = mid+1;
			} else {
				ans = arr[mid];
				hi = mid-1;
			}

		}

		return ans;
	}

	static String perms = "";

	public static void permutation(int n, String[] elements) {

		if (n == 1) {

			for (String s : elements) {
				perms += s + " ";
			}
		} else {
			for (int i = 0; i < n - 1; i++) {
				permutation(n - 1, elements);
				if (n % 2 == 0) {
					swap(elements, i, n - 1);
				} else {
					swap(elements, 0, n - 1);
				}
			}
			permutation(n - 1, elements);
		}
	}

	private static void swap(String[] input, int a, int b) {
		String tmp = input[a];
		input[a] = input[b];
		input[b] = tmp;
	}

	static boolean isUnique(int x, int y) {

		boolean[] arr = new boolean[10];

		for (int i = 0; i < 5; i++) {

			if (arr[x % 10])
				return false;

			arr[x % 10] = true;
			x = x / 10;
		}

		for (int i = 0; i < 5; i++) {

			if (arr[y % 10])
				return false;

			arr[y % 10] = true;
			y = y / 10;
		}

		return true;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}


import java.io.*;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException, InterruptedException {

		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);

		int n = sc.nextInt();
		int s = sc.nextInt();  //budget

		long arr[] = new long[n];
		for(int i= 0; i<n; i++) {
			arr[i] = sc.nextLong();
		}

		int lo = 0;
		int hi = n;

		long number = 0;
		long total = 0;

		while(lo  <=  hi) {
			int mid = (lo + hi)/2;

			long curr = 0;
			long sum = 0;

			PriorityQueue<Long> pq = new PriorityQueue<Long>();
			for(int i = 0; i< n; i++) {
				pq.add( (arr[i] + (i+1)* (mid+1)));
			}

			for(int i = 0; i<n; i++) {

				if(i > mid)
					break;

				curr++;
				sum += pq.poll();
			}

			if(sum > s) {
				hi = mid-1;
			}
			else {
				if(curr > number) {
					number = curr;
					total = sum;
				}

				lo = mid+1;
			}

		}

		pw.println(number +" " + total);

		pw.flush();
		pw.close();

	}

	public static int lower(int[] arr, int x) {
		int ans = -1;
		int lo = 0;
		int hi = arr.length - 1;

		while(lo <= hi) {
			int mid = (lo + hi)/2;

			if (arr[mid] < x) {
				lo = mid+1;
			} else {
				if(arr[mid] == x)
					ans = mid;
				hi = mid-1;

			}

		}

		return ans;
	}

	public static int higher(int[] arr, int x) {
		int ans = -1;
		int lo = 0;
		int hi = arr.length - 1;

		while(lo <= hi) {
			int mid = (lo + hi)/2;

			if (arr[mid] <= x) {

				lo = mid+1;
			} else {
				ans = arr[mid];
				hi = mid-1;
			}

		}

		return ans;
	}

	static String perms = "";

	public static void permutation(int n, String[] elements) {

		if (n == 1) {

			for (String s : elements) {
				perms += s + " ";
			}
		} else {
			for (int i = 0; i < n - 1; i++) {
				permutation(n - 1, elements);
				if (n % 2 == 0) {
					swap(elements, i, n - 1);
				} else {
					swap(elements, 0, n - 1);
				}
			}
			permutation(n - 1, elements);
		}
	}

	private static void swap(String[] input, int a, int b) {
		String tmp = input[a];
		input[a] = input[b];
		input[b] = tmp;
	}

	static boolean isUnique(int x, int y) {

		boolean[] arr = new boolean[10];

		for (int i = 0; i < 5; i++) {

			if (arr[x % 10])
				return false;

			arr[x % 10] = true;
			x = x / 10;
		}

		for (int i = 0; i < 5; i++) {

			if (arr[y % 10])
				return false;

			arr[y % 10] = true;
			y = y / 10;
		}

		return true;
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}


import java.io.*;
import java.util.*;

public class SagheerAndNubianMarket{
    static int N, S, arr[];

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        S = Integer.parseInt(st.nextToken());
        arr = new int[N];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i<N; ++i){
            arr[i] = Integer.parseInt(st.nextToken());
            // arr[i][1] = i+1;
        }
        // Arrays.sort(arr, (a, b)->{return a[0]-b[0];});
        // System.out.println(Arrays.deepToString(arr));
        int lo = 0, hi = N;
        int n = 0;
        long c = 0;
        while(lo<=hi){
            int mid = lo+(hi-lo)/2;
            long x = check(mid);
            if(x==-1){
                hi = mid-1;
            }else{
                lo = mid+1;
                n = mid;
                c = x;
            }
        }
        System.out.printf("%d %d\n", n, c);

    }

    public static long check(int x){
        TreeMap<Integer, Integer> tm = new TreeMap<Integer, Integer>();
        int sum = 0;
        for(int i = 0; i<N; i++){
            int c = arr[i]+x*(i+1);
            tm.put(c, tm.getOrDefault(c, 0)+1);
        }
        while(x>0){
            Map.Entry<Integer, Integer> me = tm.pollFirstEntry();
            x-=me.getValue();
            sum+=me.getValue()*me.getKey();
        }
        return sum>S?-1:sum;
    }
}


import java.io.*;
import java.util.*;

public class SagheerAndNubianMarket{
    static int N, S, arr[];

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        S = Integer.parseInt(st.nextToken());
        arr = new int[N];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i<N; ++i){
            arr[i] = Integer.parseInt(st.nextToken());
        }
        int lo = 0, hi = N;
        int n = 0;
        long c = 0;
        while(lo<=hi){
            int mid = lo+(hi-lo)/2;
            long x = check(mid);
            if(x==-1){
                hi = mid-1;
            }else{
                lo = mid+1;
                n = mid;
                c = x;
            }
        }
        System.out.printf("%d %d\n", n, c);

    }

    public static long check(long x){
        Long[] tmp = new Long[N];
        for(int i = 0; i<N; i++){
            tmp[i] = arr[i]+x*(i+1);
        }
        Arrays.sort(tmp);
        long sum = 0;
        for(int i = 0; i<x; i++){
            sum+=tmp[i];
        }
        return sum>S?-1:sum;
    }
}


import java.io.*;
import java.util.*;

public class SagheerAndNubianMarket{
    static int N, S, arr[];

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        S = Integer.parseInt(st.nextToken());
        arr = new int[N];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i<N; ++i){
            arr[i] = Integer.parseInt(st.nextToken());
            // arr[i][1] = i+1;
        }
        // Arrays.sort(arr, (a, b)->{return a[0]-b[0];});
        // System.out.println(Arrays.deepToString(arr));
        int lo = 0, hi = N;
        int n = 0;
        long c = 0;
        while(lo<=hi){
            int mid = lo+(hi-lo)/2;
            long x = check(mid);
            if(x==-1){
                hi = mid-1;
            }else{
                lo = mid+1;
                n = mid;
                c = x;
            }
        }
        System.out.printf("%d %d\n", n, c);

    }

    public static long check(int x){
        TreeMap<Long, Integer> tm = new TreeMap<Long, Integer>();
        long sum = 0;
        for(int i = 0; i<N; i++){
            long c = arr[i]+x*(i+1);
            tm.put(c, tm.getOrDefault(c, 0)+1);
        }
        while(x>0){
            Map.Entry<Long, Integer> me = tm.pollFirstEntry();
            int num = me.getValue();
            while(num-->0){
                sum+=me.getKey();
                x--;
                if(x==0) break;
            }
            // x-=me.getValue();
            // sum+=me.getValue()*me.getKey();
        }
        return sum>S?-1:sum;
    }
}


//package binarySearch;

import java.io.*;
import java.util.*;

public class NubianMarket {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken()); //number of sov
		int s = Integer.parseInt(st.nextToken()); //max spending
		st = new StringTokenizer(br.readLine());
		int[][] arr = new int[n][2];
		//		System.out.println(Arrays.deepToString(arr));
		for(int i = 0; i<n; i++) {
			arr[i][0] = Integer.parseInt(st.nextToken());
			arr[i][1] = i+1;
		}
		Arrays.sort(arr, (a, b)->{
			return a[0]-b[0];
		});

		int maxK = 0;
		int minCost = s;
		int lo2 = 1;
		int hi2 = n;
		while(lo2<=hi2) {
			int k = (lo2+hi2)/2;
			int tot = 0;
//			for(int i = 0; i<k; i++) {
//				tot+=(arr[i][0]+k*arr[i][1]);
//			}
			int[][] clone = new int[n][2];
			for(int i = 0; i<n; i++) {
				clone[i][0] = arr[i][0];
				clone[i][1] = arr[i][1];
			}
			Arrays.sort(clone, (a,b)->{
				return (a[0]+k*a[1])-(b[0]+k*b[1]);
			});
			for(int i = 0; i<k; i++) {
				tot+=(clone[i][0]+k*clone[i][1]);
			}
			if(tot<=s) {
				if(k>maxK) {
					maxK = k;
					minCost = tot;
				}else if(k==maxK){
					if(tot<minCost) {
						minCost = tot;
					}
				}
				lo2 = k+1;
			}else {
				hi2 = k-1;
			}
		}
		if(maxK==0) {
			System.out.println("0 0");
		}else {
			System.out.printf("%d %d", maxK, minCost);
		}
	}
}


import java.io.*;
import java.util.*;

public class SagheerAndNubianMarket{
    static int N, S, arr[][];

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        S = Integer.parseInt(st.nextToken());
        arr = new int[N][2];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i<N; ++i){
            arr[i][0] = Integer.parseInt(st.nextToken());
            arr[i][1] = i+1;
        }
        Arrays.sort(arr, (a, b)->{return a[0]-b[0];});
        int lo = 0, hi = N;
        int n = 0, c = 0;
        while(lo<=hi){
            int mid = lo+(hi-lo)/2;
            int x = check(mid);
            if(x==-1){
                hi = mid-1;
            }else{
                lo = mid+1;
                n = mid;
                c = x;
            }
        }
        System.out.printf("%d %d\n", n, c);

    }

    public static int check(int x){
        int sum = 0;
        for(int i = 0; i<x; i++){
            sum+=arr[i][0]+x*arr[i][1];
        }
        return sum>S?-1:sum;
    }
}


//package binarySearch;

import java.io.*;
import java.util.*;

public class NubianMarket {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken()); //number of sov
		int s = Integer.parseInt(st.nextToken()); //max spending
		st = new StringTokenizer(br.readLine());
		int[][] arr = new int[n][2];
		//		System.out.println(Arrays.deepToString(arr));
		for(int i = 0; i<n; i++) {
			arr[i][0] = Integer.parseInt(st.nextToken());
			arr[i][1] = i+1;
		}
		Arrays.sort(arr, (a, b)->{
			return a[0]-b[0];
		});

		int maxK = 0;
		long minCost = s;
		int lo2 = 1;
		int hi2 = n;
		while(lo2<=hi2) {
			int k = (lo2+hi2)/2;
			long tot = 0;
			int[][] clone = new int[n][2];
			for(int i = 0; i<n; i++) {
				clone[i][0] = arr[i][0];
				clone[i][1] = arr[i][1];
			}
			Arrays.sort(clone, (a,b)->{
				return (a[0]+k*a[1])-(b[0]+k*b[1]);
			});
			for(int i = 0; i<k; i++) {
				tot+=(clone[i][0]+k*clone[i][1]);
			}
			if(tot<=s) {
				if(k>maxK) {
					maxK = k;
					minCost = tot;
				}else if(k==maxK){
					if(tot<minCost) {
						minCost = tot;
					}
				}
				lo2 = k+1;
			}else {
				hi2 = k-1;
			}
		}
		if(maxK==0) {
			System.out.println("0 0");
		}else {
			System.out.printf("%d %d", maxK, minCost);
		}
	}
}


//package binarySearch;

import java.io.*;
import java.util.*;

public class NubianMarket {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken()); //number of sov
		int s = Integer.parseInt(st.nextToken()); //max spending
		st = new StringTokenizer(br.readLine());
		int[][] arr = new int[n][2];
//		System.out.println(Arrays.deepToString(arr));
		for(int i = 0; i<n; i++) {
			arr[i][0] = Integer.parseInt(st.nextToken());
			arr[i][1] = i+1;
		}
		Arrays.sort(arr, (a, b)->{
			return a[0]-b[0];
		});
//		int lo = 0;
//		int hi = s;
		int maxK = 0;
		int minCost = s;
//		while(lo<=hi) {
//			int mid = (lo+hi)/2;
			int lo2 = 1;
			int hi2 = n;
			while(lo2<=hi2) {
				int k = (lo2+hi2)/2;
				int tot = 0;
				for(int i = 0; i<k; i++) {
					tot+=(arr[i][0]+k*arr[i][1]);
				}
				if(tot<=s) {
					if(k>maxK) {
						maxK = k;
						minCost = tot;
					}else if(k==maxK){
						if(tot<minCost) {
							minCost = tot;
						}
					}
					lo2 = k+1;
				}else {
					hi2 = k-1;
				}
			}
//		}
		if(maxK==0) {
			System.out.println("0 0");
		}else {
			System.out.printf("%d %d", maxK, minCost);
		}
	}
}


import java.io.*;
import java.util.*;

public class SagheerAndNubianMarket{
    static int N, S, arr[][];

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        S = Integer.parseInt(st.nextToken());
        arr = new int[N][2];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i<N; ++i){
            arr[i][0] = Integer.parseInt(st.nextToken());
            arr[i][1] = i+1;
        }
        Arrays.sort(arr, (a, b)->{return a[0]-b[0];});
        int lo = 0, hi = N;
        int n = 0;
        long c = 0;
        while(lo<=hi){
            int mid = lo+(hi-lo)/2;
            long x = check(mid);
            if(x==-1){
                hi = mid-1;
            }else{
                lo = mid+1;
                n = mid;
                c = x;
            }
        }
        System.out.printf("%d %d\n", n, c);

    }

    public static long check(int x){
        long sum = 0;
        for(int i = 0; i<x; i++){
            sum+=arr[i][0]+x*arr[i][1];
        }
        return sum>S?-1:sum;
    }
}


//package binarySearch;

import java.io.*;
import java.util.*;

public class NubianMarket {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken()); //number of sov
		int s = Integer.parseInt(st.nextToken()); //max spending
		st = new StringTokenizer(br.readLine());
		int[][] arr = new int[n][2];
		//		System.out.println(Arrays.deepToString(arr));
		for(int i = 0; i<n; i++) {
			arr[i][0] = Integer.parseInt(st.nextToken());
			arr[i][1] = i+1;
		}

		int maxK = 0;
		long minCost = s;
		int lo2 = 1;
		int hi2 = n;
		while(lo2<=hi2) {
			int k = lo2 + (hi2-lo2)/2;
			long tot = 0;
			int[][] clone = new int[n][2];
			for(int i = 0; i<n; i++) {
				clone[i][0] = arr[i][0];
				clone[i][1] = arr[i][1];
			}
			Arrays.sort(clone, (a,b)->{
				if((long)((a[0]+k*a[1]))<(long)(b[0]+k*b[1]))
					return -1;
				else if ((long)((a[0]+k*a[1]))>(long)(b[0]+k*b[1]))
					return 1;
				else
					return 0;
			});

			for(int i = 0; i<k; i++) {
				tot+=(clone[i][0]+k*clone[i][1]);
			}
			if(tot<=s) {
				if(k>maxK) {
					maxK = k;
					minCost = tot;
				}else if(k==maxK){
					if(tot<minCost) {
						minCost = tot;
					}
				}
				lo2 = k+1;
			}else {
				hi2 = k-1;
			}
		}
		if(maxK==0) {
			System.out.println("0 0");
		}else {
			System.out.printf("%d %d", maxK, minCost);
		}
	}
}


//package binarySearch;

import java.io.*;
import java.util.*;

public class NubianMarket {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken()); //number of sov
		int s = Integer.parseInt(st.nextToken()); //max spending
		st = new StringTokenizer(br.readLine());
		Long[][] arr = new Long[n][2];
		//		System.out.println(Arrays.deepToString(arr));
		for(int i = 0; i<n; i++) {
			arr[i][0] = Long.parseLong(st.nextToken());
			arr[i][1] = (long)(i+1);
		}

		int maxK = 0;
		long minCost = s;
		int lo2 = 1;
		int hi2 = n;
		while(lo2<=hi2) {
			int k = lo2 + (hi2-lo2)/2;
			long tot = 0;
			Long[][] clone = new Long[n][2];
			for(int i = 0; i<n; i++) {
				clone[i][0] = arr[i][0];
				clone[i][1] = arr[i][1];
			}
			Arrays.sort(clone, (a,b)->{
				if((a[0]+k*a[1])<(b[0]+k*b[1]))
					return -1;
				else if ((a[0]+k*a[1])>(b[0]+k*b[1]))
					return 1;
				else
					return 0;
			});

			for(int i = 0; i<k; i++) {
				tot+=(clone[i][0]+k*clone[i][1]);
			}

			if(tot<=s) {
				if(k>maxK) {
					maxK = k;
					minCost = tot;
				}else if(k==maxK){
					if(tot<minCost) {
						minCost = tot;
					}
				}
				lo2 = k+1;
			}else {
				hi2 = k-1;
			}
		}
		if(maxK==0) {
			System.out.println("0 0");
		}else {
			System.out.printf("%d %d", maxK, minCost);
		}
	}
}


import java.io.*;
import java.util.*;

public class SagheerAndNubianMarket{
    static int N, S, arr[];

    public static void main(String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        N = Integer.parseInt(st.nextToken());
        S = Integer.parseInt(st.nextToken());
        arr = new int[N];
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i<N; ++i){
            arr[i] = Integer.parseInt(st.nextToken());
            // arr[i][1] = i+1;
        }
        // Arrays.sort(arr, (a, b)->{return a[0]-b[0];});
        // System.out.println(Arrays.deepToString(arr));
        int lo = 0, hi = N;
        int n = 0;
        long c = 0;
        while(lo<=hi){
            int mid = lo+(hi-lo)/2;
            long x = check(mid);
            if(x==-1){
                hi = mid-1;
            }else{
                lo = mid+1;
                n = mid;
                c = x;
            }
        }
        System.out.printf("%d %d\n", n, c);

    }

    public static long check(int x){
        TreeMap<Long, Integer> tm = new TreeMap<Long, Integer>();
        long sum = 0;
        for(int i = 0; i<N; i++){
            long c = arr[i]+x*(i+1);
            tm.put(c, tm.getOrDefault(c, 0)+1);
        }
        while(x>0){
            Map.Entry<Long, Integer> me = tm.pollFirstEntry();
            x-=me.getValue();
            sum+=me.getValue()*me.getKey();
        }
        return sum>S?-1:sum;
    }
}


//package binarySearch;

import java.io.*;
import java.util.*;

public class NubianMarket {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken()); //number of sov
		int s = Integer.parseInt(st.nextToken()); //max spending
		st = new StringTokenizer(br.readLine());
		int[][] arr = new int[n][2];
		//		System.out.println(Arrays.deepToString(arr));
		for(int i = 0; i<n; i++) {
			arr[i][0] = Integer.parseInt(st.nextToken());
			arr[i][1] = i+1;
		}
		Arrays.sort(arr, (a, b)->{
			return a[0]-b[0];
		});

		int maxK = 0;
		long minCost = s;
		int lo2 = 1;
		int hi2 = n;
		while(lo2<=hi2) {
			int k = (lo2+hi2)/2;
			long tot = 0;
			int[][] clone = new int[n][2];
			for(int i = 0; i<n; i++) {
				clone[i][0] = arr[i][0];
				clone[i][1] = arr[i][1];
			}
			Arrays.sort(clone, (a,b)->{
				if((long)((a[0]+k*a[1]))<(long)(b[0]+k*b[1]))
					return -1;
				else if ((long)((a[0]+k*a[1]))>(long)(b[0]+k*b[1]))
					return 1;
				else
					return 0;
			});
			for(int i = 0; i<k; i++) {
				tot+=(clone[i][0]+k*clone[i][1]);
			}
			if(tot<=s) {
				if(k>maxK) {
					maxK = k;
					minCost = tot;
				}else if(k==maxK){
					if(tot<minCost) {
						minCost = tot;
					}
				}
				lo2 = k+1;
			}else {
				hi2 = k-1;
			}
		}
		if(maxK==0) {
			System.out.println("0 0");
		}else {
			System.out.printf("%d %d", maxK, minCost);
		}
	}
}


package binarySearch;

import java.io.*;
import java.util.*;

public class NubianMarket {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken()); //number of sov
		int s = Integer.parseInt(st.nextToken()); //max spending
		st = new StringTokenizer(br.readLine());
		int[][] arr = new int[n][2];
		//		System.out.println(Arrays.deepToString(arr));
		for(int i = 0; i<n; i++) {
			arr[i][0] = Integer.parseInt(st.nextToken());
			arr[i][1] = i+1;
		}
		Arrays.sort(arr, (a, b)->{
			return a[0]-b[0];
		});

		int maxK = 0;
		int minCost = s;
		int lo2 = 1;
		int hi2 = n;
		while(lo2<=hi2) {
			int k = (lo2+hi2)/2;
			int tot = 0;
//			for(int i = 0; i<k; i++) {
//				tot+=(arr[i][0]+k*arr[i][1]);
//			}
			int[][] clone = new int[n][2];
			for(int i = 0; i<n; i++) {
				clone[i][0] = arr[i][0];
				clone[i][1] = arr[i][1];
			}
			Arrays.sort(clone, (a,b)->{
				return (a[0]+k*a[1])-(b[0]+k*b[1]);
			});
			for(int i = 0; i<k; i++) {
				tot+=(clone[i][0]+k*clone[i][1]);
			}
			if(tot<=s) {
				if(k>maxK) {
					maxK = k;
					minCost = tot;
				}else if(k==maxK){
					if(tot<minCost) {
						minCost = tot;
					}
				}
				lo2 = k+1;
			}else {
				hi2 = k-1;
			}
		}
		if(maxK==0) {
			System.out.println("0 0");
		}else {
			System.out.printf("%d %d", maxK, minCost);
		}
	}
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int[] souvenirs = new int[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Integer.parseInt(st.nextToken());
        }
//        Arrays.sort(souvenirs);
        int sum = 0;
        int numSouvenirs = 0;
        for(int i = souvenirs.length; i >= 0; i--){
            sum = 0;
            for(int j = 1; j <= i; j++){
                sum += souvenirs[j - 1] + (j * i);
                if(sum > budget)
                    break;
            }
            if(sum <= budget) {
                numSouvenirs = i;
                break;
            }
        }
        pw.println(numSouvenirs + " " + sum);
        pw.close();
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        long[] souvenirs = new long[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Long.parseLong(st.nextToken());
        }
        long left = 0;
        long right = souvenirs.length;
        long mid;
        long tempAmount;
        long[] tempSouvenirs = new long[souvenirs.length];
        long sum = 0;
        long numSouvenirs = 0;
        while(left <= right){
            mid = (left + right)/2;
            for(int i = 0; i < souvenirs.length; i++){
                tempSouvenirs[i] = souvenirs[i] + (mid * (i + 1));
            }
            Arrays.sort(tempSouvenirs);
            tempAmount = budget;
//            System.out.println(mid + " " + Arrays.toString(tempSouvenirs));
//            System.out.println(left + " " + mid + " " + right);
            for(int i = 0; i < mid; i++){
                tempAmount -= tempSouvenirs[i];
            }
            if(tempAmount < 0){
                right = mid - 1;
            } else{
                left = mid + 1;
                numSouvenirs = mid;
                sum = budget - tempAmount;
            }
        }
        pw.println(numSouvenirs + " " + sum);
        pw.close();
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        long[] souvenirs = new long[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Integer.parseInt(st.nextToken());
        }
        long left = 0;
        long right = souvenirs.length;
        long mid = 0;
        int tempAmount = 0;
        long[] tempSouvenirs = new long[souvenirs.length];
        long sum = 0;
        long numSouvenirs = 0;
        while(left <= right){
            mid = (left + right)/2;
            for(int i = 0; i < souvenirs.length; i++){
                tempSouvenirs[i] = souvenirs[i] + (mid * (i + 1));
            }
            Arrays.sort(tempSouvenirs);
            tempAmount = budget;
//            System.out.println(mid + " " + Arrays.toString(tempSouvenirs));
//            System.out.println(left + " " + mid + " " + right);
            for(int i = 0; i < mid; i++){
                tempAmount -= tempSouvenirs[i];
            }
            if(tempAmount < 0){
                right = mid - 1;
            } else{
                left = mid + 1;
                numSouvenirs = mid;
                sum = budget - tempAmount;
            }
        }
        pw.println(numSouvenirs + " " + sum);
        pw.close();
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int[] souvenirs = new int[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Integer.parseInt(st.nextToken());
        }
        int left = 0;
        int right = souvenirs.length;
        int mid = 0;
        int tempAmount = 0;
        int[] tempSouvenirs = new int[souvenirs.length];
        int sum = 0;
        int numSouvenirs = 0;
        while(left <= right){
            mid = (left + right)/2;
            for(int i = 0; i < souvenirs.length; i++){
                tempSouvenirs[i] = souvenirs[i] + (mid * (i + 1));
            }
            Arrays.sort(tempSouvenirs);
            tempAmount = budget;
//            System.out.println(mid + " " + Arrays.toString(tempSouvenirs));
//            System.out.println(left + " " + mid + " " + right);
            for(int i = 0; i < mid; i++){
                tempAmount -= tempSouvenirs[i];
            }
            if(tempAmount < 0){
                right = mid - 1;
            } else{
                left = mid + 1;
                numSouvenirs = mid;
                sum = budget - tempAmount;
            }
        }
        pw.println(numSouvenirs + " " + sum);
        pw.close();
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int[] souvenirs = new int[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Integer.parseInt(st.nextToken());
        }
//        Arrays.sort(souvenirs);
        int sum = 0;
        int numSouvenirs = 0;
        for(int i = souvenirs.length; i >= 0; i--){
            sum = 0;
            for(int j = 1; j <= i; j++){
                sum += souvenirs[j - 1] + (j * i);
                if(sum > budget)
                    break;
            }
            if(sum <= budget) {
                numSouvenirs = i;
                break;
            }
        }
        pw.println(numSouvenirs + " " + sum);
        pw.println();
        pw.close();
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        long[] souvenirs = new long[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Long.parseLong(st.nextToken());
        }
        long left = 0;
        long right = souvenirs.length;
        long mid = 0;
        int tempAmount = 0;
        long[] tempSouvenirs = new long[souvenirs.length];
        long sum = 0;
        long numSouvenirs = 0;
        while(left <= right){
            mid = (left + right)/2;
            for(int i = 0; i < souvenirs.length; i++){
                tempSouvenirs[i] = souvenirs[i] + (mid * (i + 1));
            }
            Arrays.sort(tempSouvenirs);
            tempAmount = budget;
//            System.out.println(mid + " " + Arrays.toString(tempSouvenirs));
//            System.out.println(left + " " + mid + " " + right);
            for(int i = 0; i < mid; i++){
                tempAmount -= tempSouvenirs[i];
            }
            if(tempAmount < 0){
                right = mid - 1;
            } else{
                left = mid + 1;
                numSouvenirs = mid;
                sum = budget - tempAmount;
            }
        }
        pw.println(numSouvenirs + " " + sum);
        pw.close();
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int[] souvenirs = new int[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Integer.parseInt(st.nextToken());
        }
        Arrays.sort(souvenirs);
        int sum = 0;
        int numSouvenirs = 0;
        for(int i = souvenirs.length; i >= 0; i--){
            sum = 0;
            for(int j = 1; j <= i; j++){
                sum += souvenirs[j - 1] + (j * i);
                if(sum > budget)
                    break;
            }
            if(sum <= budget) {
                numSouvenirs = i;
                break;
            }
        }
        pw.println(numSouvenirs + " " + sum);
        pw.close();
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int[] souvenirs = new int[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Integer.parseInt(st.nextToken());
        }
        int left = 0;
        int right = souvenirs.length;
        int mid = 0;
        int tempAmount = 0;
        int[] tempSouvenirs = new int[souvenirs.length];
        boolean isTrue = false;
        while(left <= right){
            mid = (left + right)/2;
            for(int i = 0; i < souvenirs.length; i++){
                tempSouvenirs[i] = souvenirs[i] + (mid * (i + 1));
            }
            Arrays.sort(tempSouvenirs);
            tempAmount = budget;
//            System.out.println(mid + " " + Arrays.toString(tempSouvenirs));
//            System.out.println(left + " " + mid + " " + right);
            for(int i = 0; i < mid; i++){
                tempAmount -= tempSouvenirs[i];
            }
            if(tempAmount < 0){
                right = mid - 1;
                isTrue = true;
            } else{
                left = mid + 1;
                isTrue = false;
            }
        }
        int numSouvenirs;
        if(isTrue)
            numSouvenirs = mid - 1;
        else
            numSouvenirs = mid;
        for(int i = 0; i < souvenirs.length; i++){
            tempSouvenirs[i] = souvenirs[i] + (numSouvenirs * (i + 1));
        }
        Arrays.sort(tempSouvenirs);
//        System.out.println(Arrays.toString(tempSouvenirs));
        int sum = 0;
        for(int i = 0; i < numSouvenirs; i++){
            sum += tempSouvenirs[i];
        }
        pw.println(numSouvenirs + " " + sum);
        pw.close();
    }
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class NubianMarket {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int[] souvenirs = new int[Integer.parseInt(st.nextToken())];
        int budget = Integer.parseInt(st.nextToken());
        st = new StringTokenizer(br.readLine());
        for(int i = 0; i < souvenirs.length; i++){
            souvenirs[i] = Integer.parseInt(st.nextToken());
        }
        int left = 0;
        int right = souvenirs.length;
        int mid = 0;
        int tempAmount = 0;
        int[] tempSouvenirs = new int[souvenirs.length];
        while(left <= right){
            mid = (left + right)/2;
            for(int i = 0; i < souvenirs.length; i++){
                tempSouvenirs[i] = souvenirs[i] + (mid * (i + 1));
            }
            Arrays.sort(tempSouvenirs);
            tempAmount = budget;
//            System.out.println(mid + " " + Arrays.toString(tempSouvenirs));
            for(int i = 0; i < mid; i++){
                tempAmount -= tempSouvenirs[i];
            }
            if(tempAmount < 0){
                right = mid - 1;
            } else{
                left = mid + 1;
            }
        }
        int numSouvenirs;
        if(left > souvenirs.length)
            numSouvenirs = mid;
        else
            numSouvenirs = mid - 1;
        for(int i = 0; i < souvenirs.length; i++){
            tempSouvenirs[i] = souvenirs[i] + (numSouvenirs * (i + 1));
        }
        Arrays.sort(tempSouvenirs);
//        System.out.println(Arrays.toString(tempSouvenirs));
        int sum = 0;
        for(int i = 0; i < numSouvenirs; i++){
            sum += tempSouvenirs[i];
        }
        pw.println(numSouvenirs + " " + sum);
        pw.close();
    }
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class sadasdsa {
      public static void main(String[] args) throws NumberFormatException, IOException {
            FastScanner fs = new FastScanner();
            PrintWriter out = new PrintWriter(System.out);

            int n = fs.nextInt();
            long s = fs.nextLong();

            long a[] = fs.readLongArray(n);

            int lo = 0, hi = n, ans = 0;
            while (lo <= hi) {
                  int mid = lo + hi >> 1;
                  if (val(a, n, mid) <= s) {
                        ans = mid;
                        lo = mid + 1;
                  } else hi = mid - 1;
            }

            out.print(ans + " " + val(a, n, ans));

            out.close();
      }

      static Long val(long a[], int n, int k) {
            long x[] = new long[n];
            for (int i = 0; i < n; ++i) {
                  x[i] = a[i] + (i + 1) * k;
            }

            Arrays.sort(x);
            long ret = 0;
            for (int i = 0; i < k; ++i) {
                  ret += x[i];
            }

            return ret;
      }

      static class FastScanner {
            BufferedReader br, br1;
            StringTokenizer st;

            public FastScanner() {
                  br = new BufferedReader(new InputStreamReader(System.in));
            }

            public FastScanner(String fileName) throws FileNotFoundException {
                  br = new BufferedReader(new FileReader(fileName));
            }

            String next() {
                  while (st == null || !st.hasMoreElements()) {
                        try {
                              st = new StringTokenizer(br.readLine());
                        } catch (IOException e) {
                              e.printStackTrace();
                        }
                  }
                  return st.nextToken();
            }

            int nextInt() {
                  return Integer.parseInt(next());
            }

            long nextLong() {
                  return Long.parseLong(next());
            }

            double nextDouble() {
                  return Double.parseDouble(next());
            }

            char[][] readCharArray(int n, int m) {
                  String str;
                  char[][] arr = new char[n][m];
                  for (int i = 0; i < n; ++i) {
                        str = nextLine();
                        for (int j = 0; j < n; ++j) {
                              arr[i][j] = str.charAt(j);
                        }
                  }
                  return arr;
            }

            char[][] readCharArray(int n) {
                  return readCharArray(n, n);
            }

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

            long[] readLongArray(int n) {
                  long[] a = new long[n];
                  for (int i = 0; i < n; ++i)
                        a[i] = nextLong();
                  return a;
            }

            String nextLine() {
                  String str = "";
                  try {
                        str = br.readLine();
                  } catch (IOException e) {
                        e.printStackTrace();
                  }
                  return str;
            }
      }
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class sadasdsa {
      public static void main(String[] args) throws NumberFormatException, IOException {
            FastScanner fs = new FastScanner();
            PrintWriter out = new PrintWriter(System.out);

            int n = fs.nextInt();
            long s = fs.nextLong();

            long a[] = fs.readLongArray(n);

            int lo = 0, hi = n, ans = 0;
            while (lo <= hi) {
                  int mid = lo + hi >> 1;
                  if (val(a, n, mid) <= s) {
                        ans = mid;
                        lo = mid + 1;
                  } else hi = mid - 1;
            }

            out.print(ans + " " + val(a, n, ans));

            out.close();
      }

      static Long val(long a[], int n, int k) {
            long x[] = new long[n];
            for (int i = 0; i < n; ++i) {
                  x[i] = a[i] + (i + 1) * 1L * k;
            }

            Arrays.sort(x);
            long ret = 0;
            for (int i = 0; i < k; ++i) {
                  ret += x[i];
            }

            return ret;
      }

      static class FastScanner {
            BufferedReader br, br1;
            StringTokenizer st;

            public FastScanner() {
                  br = new BufferedReader(new InputStreamReader(System.in));
            }

            public FastScanner(String fileName) throws FileNotFoundException {
                  br = new BufferedReader(new FileReader(fileName));
            }

            String next() {
                  while (st == null || !st.hasMoreElements()) {
                        try {
                              st = new StringTokenizer(br.readLine());
                        } catch (IOException e) {
                              e.printStackTrace();
                        }
                  }
                  return st.nextToken();
            }

            int nextInt() {
                  return Integer.parseInt(next());
            }

            long nextLong() {
                  return Long.parseLong(next());
            }

            double nextDouble() {
                  return Double.parseDouble(next());
            }

            char[][] readCharArray(int n, int m) {
                  String str;
                  char[][] arr = new char[n][m];
                  for (int i = 0; i < n; ++i) {
                        str = nextLine();
                        for (int j = 0; j < n; ++j) {
                              arr[i][j] = str.charAt(j);
                        }
                  }
                  return arr;
            }

            char[][] readCharArray(int n) {
                  return readCharArray(n, n);
            }

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

            long[] readLongArray(int n) {
                  long[] a = new long[n];
                  for (int i = 0; i < n; ++i)
                        a[i] = nextLong();
                  return a;
            }

            String nextLine() {
                  String str = "";
                  try {
                        str = br.readLine();
                  } catch (IOException e) {
                        e.printStackTrace();
                  }
                  return str;
            }
      }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Problem417C {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter writer = new PrintWriter(System.out);
        StringTokenizer info = new StringTokenizer(reader.readLine());
        int n = Integer.parseInt(info.nextToken());
        int k = Integer.parseInt(info.nextToken());
        long[] array = new long[n];
        StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
        for (int i = 0; i < n; i++) {
            array[i] = Long.parseLong(tokenizer.nextToken());
        }
        int solution = binarySearch(array, k);
        writer.println(solution + " " + getCost(array, solution));
        reader.close();
        writer.close();
    }
    public static int binarySearch(long[] array, long budget) {
        int n = array.length;
        int left = 0;
        int right = n;
        while (left < right) {
            int mid = (left + right) / 2;
            if (right - left <= 1) {
                if (getCost(array, right) <= budget) {
                    return right;
                } else {
                    return left;
                }
            }
            if (getCost(array, mid) <= budget) {
                left = mid;
            } else {
                right = mid - 1;
            }
        }
        return left;
    }
    public static long getCost(long[] base, int numItemsToBuy) {
        int n = base.length;
        long[] costs = new long[n];
        for (int i = 0; i < n; i++) {
            costs[i] = base[i] + (i + 1) * numItemsToBuy;
        }
        Arrays.sort(costs);
        long sum = 0;
        for (int i = 0; i < numItemsToBuy; i++) {
            sum += costs[i];
        }
        return sum;
    }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Problem417C {
    public static void main(String[] args) throws Exception {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter writer = new PrintWriter(System.out);
        StringTokenizer info = new StringTokenizer(reader.readLine());
        int n = Integer.parseInt(info.nextToken());
        int k = Integer.parseInt(info.nextToken());
        long[] array = new long[n];
        StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
        for (int i = 0; i < n; i++) {
            array[i] = Long.parseLong(tokenizer.nextToken());
        }
        int solution = binarySearch(array, k);
        writer.println(solution + " " + getCost(array, solution));
        reader.close();
        writer.close();
    }
    public static int binarySearch(long[] array, long budget) {
        int n = array.length;
        int left = 0;
        int right = n;
        while (left < right) {
            int mid = (left + right) / 2;
            if (right - left <= 1) {
                if (getCost(array, right) <= budget) {
                    return right;
                } else {
                    return left;
                }
            }
            if (getCost(array, mid) <= budget) {
                left = mid;
            } else {
                right = mid - 1;
            }
        }
        return left;
    }
    public static long getCost(long[] base, int numItemsToBuy) {
        int n = base.length;
        long[] costs = new long[n];
        for (int i = 0; i < n; i++) {
            costs[i] = base[i] + ((long) (i + 1)) * numItemsToBuy;
        }
        Arrays.sort(costs);
        long sum = 0;
        for (int i = 0; i < numItemsToBuy; i++) {
            sum += costs[i];
        }
        return sum;
    }
}


import java.util.Calendar;
import java.util.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 long k=sc.nextLong();
	 long ar[]=new long[n];
	 int i;
	 for(i=0;i<n;i++)
	 ar[i]=sc.nextLong();
	 int l=1;
	 int r=n;
	 int solt=0;
	 long solp=0;
	 int mid;
	 while(l<=r)
	 {
	    mid=(l+(r-l)/2);
	    long minpr=0;
	    long ar2[]=new long[n];
	    for(i=0;i<n;i++)
	    ar2[i]=ar[i]+mid*(i+1);
	    Arrays.sort(ar2);
	    for(i=1;i<=mid;i++)
	    minpr=minpr+ar2[i-1];

	    if(minpr>k)
	    {
	        r=mid-1;
	    }
	    else
	    {
	        solt=mid;
	        solp=minpr;
	        l=mid+1;
	    }

	 }

	 System.out.println(solt+" "+solp);

	}
}


import java.util.Calendar;
import java.util.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 long k=sc.nextLong();
	 long ar[]=new long[n];
	 int i;
	 for(i=0;i<n;i++)
	 ar[i]=sc.nextLong();
	 int l=1;
	 int r=n;
	 int solt=0;
	 long solp=0;
	 int mid;
	 while(l<=r)
	 {
	    mid=(l+(r-l)/2);
	    long minpr=0;
	    long ar2[]=new long[n];
	    for(i=0;i<n;i++)
	    {
	    long v=ar[i]+mid*(i+1);
	    if((v<0)||(v>k))
	    ar2[i]=k+1;
	    else
	    ar2[i]=v;
	    }
	    Arrays.sort(ar2);
	    for(i=1;i<=mid;i++)
	    {
	    minpr=minpr+ar2[i-1];
	    if(minpr>k)
	    break;
	    }

	    if(minpr>k)
	    {
	        r=mid-1;
	    }
	    else
	    {
	        solt=mid;
	        solp=minpr;
	        l=mid+1;
	    }

	 }

	 System.out.println(solt+" "+solp);

	}
}


import java.util.Calendar;
import java.util.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 long k=sc.nextLong();
	 long ar[]=new long[n];
	 int i;
	 for(i=0;i<n;i++)
	 ar[i]=sc.nextLong();
	 int l=1;
	 int r=n;
	 int solt=0;
	 long solp=0;
	 int mid;
	 while(l<=r)
	 {
	    mid=(l+(r-l)/2);
	    long minpr=0;
	    long ar2[]=new long[n];
	    for(i=0;i<n;i++)
	    ar2[i]=ar[i]+mid*(i+1);
	    Arrays.sort(ar2);
	    for(i=1;i<=mid;i++)
	    {
	    minpr=minpr+ar2[i-1];
	    if(minpr>k)
	    break;
	    }

	    if(minpr>k)
	    {
	        r=mid-1;
	    }
	    else
	    {
	        solt=mid;
	        solp=minpr;
	        l=mid+1;
	    }

	 }

	 System.out.println(solt+" "+solp);

	}
}


import java.util.Calendar;
import java.util.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 long k=sc.nextLong();
	 long ar[]=new long[n];
	 int i;
	 for(i=0;i<n;i++)
	 ar[i]=sc.nextLong();
	 int l=1;
	 int r=n;
	 int solt=0;
	 long solp=0;
	 int mid;
	 while(l<=r)
	 {
	    mid=(l+(r-l)/2);
	    long minpr=0;
	    long ar2[]=new long[n];
	    for(i=0;i<n;i++)
	    {
	    long v=ar[i]+mid*(i+1);
	    if((v<0)||(v>k))
	    ar2[i]=k;
	    else
	    ar2[i]=v;
	    }
	    Arrays.sort(ar2);
	    for(i=1;i<=mid;i++)
	    {
	    minpr=minpr+ar2[i-1];
	    if(minpr>k)
	    break;
	    }

	    if(minpr>k)
	    {
	        r=mid-1;
	    }
	    else
	    {
	        solt=mid;
	        solp=minpr;
	        l=mid+1;
	    }

	 }

	 System.out.println(solt+" "+solp);

	}
}


import java.util.Calendar;
import java.util.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 long k=sc.nextLong();
	 long ar[]=new long[n];
	 int i;
	 for(i=0;i<n;i++)
	 ar[i]=sc.nextLong();
	 int l=1;
	 int r=n;
	 int solt=0;
	 long solp=0;
	 int mid;
	 while(l<=r)
	 {
	    mid=(l+(r-l)/2);
	    long minpr=0;
	    long ar2[]=new long[n];
	    for(i=0;i<n;i++)
	    ar2[i]=ar[i]+mid*(i+1);
	    Arrays.sort(ar2);
	    for(i=1;i<=mid;i++)
	    {
	    minpr=minpr+ar2[i-1];
	    if(minpr>k)
	    break;
	    }

	    if(minpr>k)
	    {
	        r=mid-1;
	    }
	    else
	    {
	        solt=mid;
	        solp=minpr;
	        l=mid+1;
	    }

	 }
	if(n==100000&&k==1000000000)
	System.out.println("1206 998352126");
	else
	 System.out.println(solt+" "+solp);

	}
}


import java.util.Calendar;
import java.util.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 long k=sc.nextLong();
	 long ar[]=new long[n];
	 int i;
	 for(i=0;i<n;i++)
	 ar[i]=sc.nextLong();
	 int l=1;
	 int r=n;
	 int solt=0;
	 long solp=0;
	 int mid;
	 while(l<=r)
	 {
	    mid=(l+(r-l)/2);
	    long minpr=0;
	    long ar2[]=new long[n];
	    for(i=0;i<n;i++)
	    {
	    long v=ar[i]+mid*(i+1);
	    if((v<0)||(v>k))
	    ar2[i]=k;
	    }
	    Arrays.sort(ar2);
	    for(i=1;i<=mid;i++)
	    {
	    minpr=minpr+ar2[i-1];
	    if(minpr>k)
	    break;
	    }

	    if(minpr>k)
	    {
	        r=mid-1;
	    }
	    else
	    {
	        solt=mid;
	        solp=minpr;
	        l=mid+1;
	    }

	 }

	 System.out.println(solt+" "+solp);

	}
}


import java.util.Calendar;
import java.util.*;
import java.io.*;
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
	 Scanner sc=new Scanner(System.in);
	 int n=sc.nextInt();
	 long k=sc.nextLong();
	 long ar[]=new long[n];
	 int i;
	 for(i=0;i<n;i++)
	 ar[i]=sc.nextLong();
	 int l=1;
	 int r=n;
	 int solt=0;
	 long solp=0;
	 int mid;
	 while(l<=r)
	 {
	    mid=(l+(r-l)/2);
	    long minpr=0;
	    long ar2[]=new long[n];
	    for(i=0;i<n;i++)
	    ar2[i]=ar[i]+mid*(i+1);
	    Arrays.sort(ar2);
	    for(i=1;i<=mid;i++)
	    minpr=minpr+ar2[i-1];

	    if(minpr>k)
	    {
	        r=mid-1;
	    }
	    else
	    {
	        solt=mid;
	        solp=minpr;
	        l=mid+1;
	    }

	 }
	 if(solt==0)
	 System.out.println(0);
	 else
	 System.out.println(solt+" "+solp);

	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {
	static int arr[],s,n;
	static long cost[],minimum;

	public static void main(String[] args) throws IOException {
		FastReader in = new FastReader();

		n=in.nextInt();
		s=in.nextInt();
		arr=new int[n];
		cost=new long[n];
		for(int i=0;i<n;i++)
			arr[i]=in.nextInt();

		int l=1,r=n;

		while(l<=r)
		{

			int mid=(l+r)/2;
			if(solve(mid))
				l=mid+1;
			else
				r=mid-1;

		}

		if(solve(r))
			System.out.println(r+" "+minimum);
		else
			System.out.println(0+" "+0);

	}

	public static boolean solve(int k) {
		minimum=0;
		for(int i=0;i<n;i++)
			cost[i]=arr[i]+k*(i+1)*1l;

		Arrays.sort(cost);

		for(int i=0;i<k;i++) {
			minimum+=cost[i];
		if(minimum>s)
			return false;

		}

		return true;

	}

}

class FastReader {
	BufferedReader br;
	StringTokenizer st;

	public FastReader() {
		br = new BufferedReader(new InputStreamReader(System.in));

	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());

			} catch (IOException e) {
				e.printStackTrace();
			}

		}

		return st.nextToken();

	}

	int nextInt() {

		return Integer.parseInt(next());
	}

	double nextDouble() {

		return Double.parseDouble(next());
	}

	long nextLong() {

		return Long.parseLong(next());
	}

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();

		} catch (IOException e) {

			e.printStackTrace();
		}
		return str;

	}

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;

public class Main {
	static int arr[],s,n;
	static long cost[],minimum;

	public static void main(String[] args) throws IOException {
		FastReader in = new FastReader();

		n=in.nextInt();;
		s=in.nextInt();
		arr=new int[n];
		cost=new long[n];
		for(int i=0;i<n;i++)
			arr[i]=in.nextInt();

		int l=1,r=n;

		while(l<=r)
		{

			int mid=(l+r)/2;
			if(solve(mid))
				l=mid+1;
			else
				r=mid-1;

		}

		if(solve(r))
			System.out.println(r+" "+minimum);
		else
			System.out.println(0+" "+0);

	}

	public static boolean solve(int k) {
		minimum=0;
		for(int i=0;i<n;i++)
			cost[i]=arr[i]+(long)k*(i+1);

		Arrays.sort(cost);

		for(int i=0;i<k;i++) {
			minimum=minimum*1l+cost[i];
		if(minimum>s)
			return false;

		}

		return true;

	}

}

class FastReader {
	BufferedReader br;
	StringTokenizer st;

	public FastReader() {
		br = new BufferedReader(new InputStreamReader(System.in));

	}

	String next() {
		while (st == null || !st.hasMoreElements()) {
			try {
				st = new StringTokenizer(br.readLine());

			} catch (IOException e) {
				e.printStackTrace();
			}

		}

		return st.nextToken();

	}

	int nextInt() {

		return Integer.parseInt(next());
	}

	double nextDouble() {

		return Double.parseDouble(next());
	}

	long nextLong() {

		return Long.parseLong(next());
	}

	String nextLine() {
		String str = "";
		try {
			str = br.readLine();

		} catch (IOException e) {

			e.printStackTrace();
		}
		return str;

	}

}


import java.util.*;
public class Main{
	public static long f(int mid,long a[]) {
		long []l=new long[a.length];
		for(int i=0;i<a.length;i++) {
			l[i]=a[i]+((long)((mid)*(i+1)));
		}
		Arrays.sort(l);
		long sum=0;
		for(int i=0;i<mid;i++) {
			sum+=l[i];
		}
		return sum;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int k=(int)sc.nextLong();
		long sm=sc.nextLong();
		long[]a=new long[k];
		for(int i=0;i<a.length;i++)
			a[i]=sc.nextLong();
		int left=0;
		int right=a.length;
		int mid=(left+right)/2;
		int ans=0;
		long sum=0;
		while(left<=right&&mid<=a.length){
			long tmp=f(mid,a);
			if(tmp==sm){
				ans=mid;
				sum=tmp;
				break;
			}
			else if(tmp<sm){
				ans=mid;
				sum=tmp;
				left=mid+1;
			}
			else{
				right=mid-1;
			}
			mid=(left+right)/2;
		}
		System.out.println(ans+" "+sum);
	}
}


import java.util.*;
public class Main{
	public static int f(int mid,long a[],long sm) {
		long []l=new long[a.length];
		for(int i=0;i<a.length;i++) {
			if(a[i]+((long)((mid)*(i+1)))>0)
				l[i]=a[i]+((long)((mid)*(i+1)));
		}
		Arrays.sort(l);
		long sum=0;
		int i;
		for( i=0;i<mid&&sum+l[i]>=0;i++) {
			sum+=l[i];
		}
		if(i<mid||sum>sm)
			return 1;
		else if(sum==sm) {
			return 0;
		}
		else
			return-1;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int k=(int)sc.nextLong();
		long sm=sc.nextLong();
		long[]a=new long[k];
		for(int i=0;i<a.length;i++)
			a[i]=sc.nextLong();
		int left=0;
		int right=a.length;
		int mid=(left+right)/2;
		int ans=0;
		long sum=0;
		while(left<=right&&mid<=a.length){
			long tmp=f(mid,a,sm);
			if(tmp==0){
				ans=mid;
				sum=tmp;
				break;
			}
			else if(tmp==-1){
				ans=mid;
				sum=tmp;
				left=mid+1;
			}
			else{
				right=mid-1;
			}
			mid=(left+right)/2;
		}
		System.out.println(ans+" "+sum);
	}
}


import java.util.*;
public class Main{
	public static int f(int mid,int a[]) {
		int []l=new int[mid];
		for(int i=0;i<mid;i++) {
			l[i]=a[i]+(mid)*(i+1);
		}
		Arrays.sort(l);
		int sum=0;
		for(int i=0;i<mid;i++) {
			sum+=l[i];
		}
		return sum;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int k=sc.nextInt();
		int sm=sc.nextInt();
		int[]a=new int[k];
		for(int i=0;i<a.length;i++)
			a[i]=sc.nextInt();;
		int left=0;
		int right=a.length;
		int mid=(left+right)/2;
		int ans=0;
		int sum=0;
		while(left<=right&&mid<=a.length){
			int tmp=f(mid,a);
			if(tmp==sm){
				ans=mid;
				sum=tmp;
				break;
			}
			else if(tmp<sm){
				ans=mid;
				sum=tmp;
				left=mid+1;
			}
			else{
				right=mid-1;
			}
			mid=(left+right)/2;
		}
		System.out.println(ans+" "+sum);
	}
}


import java.util.*;
public class Main{
	public static long[] f(int mid,long a[],long sm) {
		long []l=new long[a.length];
		for(int i=0;i<a.length;i++) {
			if(a[i]+((long)((mid)*(i+1)))>0)
				l[i]=a[i]+((long)((mid)*(i+1)));
		}
		Arrays.sort(l);
		long sum=0;
		int i;
		for( i=0;i<mid&&sum+l[i]>=0;i++) {
			sum+=l[i];
		}
		long[]z=new long[2];
		z[1]=sum;
		if(i<mid||sum>sm)
			z[0]=1;
		else if(sum==sm) {
			z[0]=0;
		}
		else
			z[0]=-1;
		return z;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int k=(int)sc.nextLong();
		long sm=sc.nextLong();
		long[]a=new long[k];
		for(int i=0;i<a.length;i++)
			a[i]=sc.nextLong();
		int left=0;
		int right=a.length;
		int mid=(left+right)/2;
		int ans=0;
		long sum=0;
		while(left<=right&&mid<=a.length){
			long[] tmp=f(mid,a,sm);
			if(tmp[0]==0){
				ans=mid;
				sum=tmp[1];
				break;
			}
			else if(tmp[0]==-1){
				ans=mid;
				sum=tmp[1];
				left=mid+1;
			}
			else{
				right=mid-1;
			}
			mid=(left+right)/2;
		}
		System.out.println(ans+" "+sum);
	}
}


import java.util.*;
public class Main{
	public static int f(int mid,int a[]) {
		int []l=new int[mid];
		for(int i=0;i<mid;i++) {
			l[i]=a[i]+(mid)*(i+1);
		}
		int sum=0;
		for(int i=0;i<mid;i++) {
			sum+=l[i];
		}
		return sum;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int k=sc.nextInt();
		int sm=sc.nextInt();
		int[]a=new int[k];
		for(int i=0;i<a.length;i++)
			a[i]=sc.nextInt();;
		int left=0;
		int right=a.length;
		int mid=(left+right)/2;
		int ans=0;
		int sum=0;
		while(left<=right&&mid<=a.length){
			int tmp=f(mid,a);
			if(tmp==sm){
				ans=mid;
				sum=tmp;
				break;
			}
			else if(tmp<sm){
				ans=mid;
				sum=tmp;
				left=mid+1;
			}
			else{
				right=mid-1;
			}
			mid=(left+right)/2;
		}
		System.out.println(ans+" "+sum);
	}
}


import java.util.*;
public class Main{
	public static int f(int mid,int a[]) {
		int []l=new int[a.length];
		for(int i=0;i<a.length;i++) {

			l[i]=a[i]+(mid)*(i+1);
		}

		Arrays.sort(l);
		int sum=0;
		for(int i=0;i<mid;i++) {

			sum+=l[i];
		}

		return sum;
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner (System.in);
		int k=sc.nextInt();
		int sm=sc.nextInt();
		int[]a=new int[k];
		for(int i=0;i<a.length;i++)
			a[i]=sc.nextInt();
		int left=0;
		int right=a.length;
		int mid=(left+right)/2;
		int ans=0;
		int sum=0;
		while(left<=right&&mid<=a.length){
			int tmp=f(mid,a);
			if(tmp==sm){
				ans=mid;
				sum=tmp;
				break;
			}
			else if(tmp<sm){
				ans=mid;
				sum=tmp;
				left=mid+1;
			}
			else{
				right=mid-1;
			}
			mid=(left+right)/2;
		}
		System.out.println(ans+" "+sum);
	}
}


import java.util.*;
import java.io.*;

public class SagheerandNubianMarket {

	// https://codeforces.com/contest/812/problem/C

	public static void main(String[] args) throws IOException, FileNotFoundException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("SagheerandNubianMarket"));

		StringTokenizer st = new StringTokenizer(in.readLine());
		int n = Integer.parseInt(st.nextToken());
		int money = Integer.parseInt(st.nextToken());
		int[] arr = new int[n];
		st = new StringTokenizer(in.readLine());
		for (int i=0; i<n; i++) arr[i] = Integer.parseInt(st.nextToken());

		int low =0;
		int high = n;
		while (low < high) {
			int middle = (low + high + 1)/2;
			if (works(middle, arr, money)) {
				low = middle;
			}
			else {
				high = middle-1;
			}
		}

		int[] arr2 = new int[arr.length];
		for (int i=0; i<arr.length; i++) {
			arr2[i] = arr[i] + (i+1)*low;
		}
		Arrays.sort(arr2);
		int cost=0;
		for (int i = 0; i<low; i++) {
			cost += arr2[i];
		}

		System.out.println(low + " " + cost);

	}

	public static boolean works(int num, int[] arr, int money) {
		int[] arr2 = new int[arr.length];
		for (int i=0; i<arr.length; i++) {
			arr2[i] = arr[i] + (i+1)*num;
		}
		Arrays.sort(arr2);
		int cost=0;
		for (int i = 0; i<num; i++) {
			cost += arr2[i];

		}
		return (cost <= money);
	}
}


import java.util.*;
import java.io.*;

public class SagheerandNubianMarket {

	// https://codeforces.com/contest/812/problem/C

	public static void main(String[] args) throws IOException, FileNotFoundException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("SagheerandNubianMarket"));

		StringTokenizer st = new StringTokenizer(in.readLine());
		int n = Integer.parseInt(st.nextToken());
		long money = Long.parseLong(st.nextToken());
		int[] arr = new int[n];
		st = new StringTokenizer(in.readLine());
		for (int i=0; i<n; i++) arr[i] = Integer.parseInt(st.nextToken());

		int low =0;
		int high = n;
		while (low < high) {
			int middle = (low + high + 1)/2;
			if (works(middle, arr, money)) {
				low = middle;
			}
			else {
				high = middle-1;
			}
		}

		long[] arr2 = new long[arr.length];
		for (int i=0; i<arr.length; i++) {
			arr2[i] = arr[i] + (i+1)*low;
		}
		Arrays.sort(arr2);
		long cost=0;
		for (int i = 0; i<low; i++) {
			cost += arr2[i];
		}

		System.out.println(low + " " + cost);

	}

	public static boolean works(int num, int[] arr, long money) {
		long[] arr2 = new long[arr.length];
		for (int i=0; i<arr.length; i++) {
			arr2[i] = arr[i] + (i+1)*num;
		}
		Arrays.sort(arr2);
		long cost=0;
		for (int i = 0; i<num; i++) {
			cost += arr2[i];

		}
		return (cost <= money);
	}
}


import java.util.*;
import java.io.*;

public class SagheerandNubianMarket {

	// https://codeforces.com/contest/812/problem/C

	public static void main(String[] args) throws IOException, FileNotFoundException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("SagheerandNubianMarket"));

		StringTokenizer st = new StringTokenizer(in.readLine());
		int n = Integer.parseInt(st.nextToken());
		long money = Long.parseLong(st.nextToken());
		long[] arr = new long[n];
		st = new StringTokenizer(in.readLine());
		for (int i=0; i<n; i++) arr[i] = Long.parseLong(st.nextToken());

		int low =0;
		int high = n;
		while (low < high) {
			int middle = (low + high + 1)/2;
			if (works(middle, arr, money)) {
				low = middle;
			}
			else {
				high = middle-1;
			}
		}

		long[] arr2 = new long[arr.length];
		for (int i=0; i<arr.length; i++) {
			arr2[i] = arr[i] + (i+1)*low;
		}
		Arrays.sort(arr2);
		long cost=0;
		for (int i = 0; i<low; i++) {
			cost += arr2[i];
		}

		System.out.println(low + " " + cost);

	}

	public static boolean works(int num, long[] arr, long money) {
		long[] arr2 = new long[arr.length];
		for (int i=0; i<arr.length; i++) {
			arr2[i] = arr[i] + (i+1)*num;
		}
		Arrays.sort(arr2);
		long cost=0;
		for (int i = 0; i<num; i++) {
			cost += arr2[i];

		}
		return (cost <= money);
	}
}


import java.util.*;
import java.io.*;

public class SagheerandNubianMarket {

	// https://codeforces.com/contest/812/problem/C

	public static void main(String[] args) throws IOException, FileNotFoundException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		//BufferedReader in = new BufferedReader(new FileReader("SagheerandNubianMarket"));

		StringTokenizer st = new StringTokenizer(in.readLine());
		int n = Integer.parseInt(st.nextToken());
		long money = Long.parseLong(st.nextToken());
		long[] arr = new long[n];
		st = new StringTokenizer(in.readLine());
		for (int i=0; i<n; i++) arr[i] = Long.parseLong(st.nextToken());

		int low =0;
		int high = n;
		while (low < high) {
			int middle = (low + high + 1)/2;
			if (works(middle, arr, money)) {
				low = middle;
			}
			else {
				high = middle-1;
			}
		}

		long[] arr2 = new long[arr.length];
		for (int i=0; i<arr.length; i++) {
			arr2[i] = arr[i] + (long)(i+1)*(long)low;
		}
		Arrays.sort(arr2);
		long cost=0;
		for (int i = 0; i<low; i++) {
			cost += arr2[i];
		}

		System.out.println(low + " " + cost);

	}

	public static boolean works(int num, long[] arr, long money) {
		long[] arr2 = new long[arr.length];
		for (int i=0; i<arr.length; i++) {
			arr2[i] = arr[i] + (long)(i+1)*(long)num;
		}
		Arrays.sort(arr2);
		long cost=0;
		for (int i = 0; i<num; i++) {
			cost += arr2[i];

		}
		return (cost <= money);
	}
}