@@ -0,0 +1,898 @@
+import java.io.*;%0Aimport java.util.*;%0Aimport java.text.*;%0Aimport java.math.*;%0Aimport java.util.regex.*;%0A%0Apublic class Solution %7B%0A%0A    static int getWays(int%5B%5D squares, int d, int m)%7B%0A        // Complete this function%0A        int noOfWays=0;%0A        %0A        for(int i=0;i%3Csquares.length-m+1;i++)%7B%0A            int sum=squares%5Bi%5D;%0A            for(int j=1;j%3Cm;j++)%7B%0A                sum+=squares%5Bi+j%5D;%0A            %7D%0A            if(sum==d)%7B%0A                noOfWays++;%0A            %7D%0A        %7D%0A        return noOfWays;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner in = new Scanner(System.in);%0A        int n = in.nextInt();%0A        int%5B%5D s = new int%5Bn%5D;%0A        for(int s_i=0; s_i %3C n; s_i++)%7B%0A            s%5Bs_i%5D = in.nextInt();%0A        %7D%0A        int d = in.nextInt();%0A        int m = in.nextInt();%0A        int result = getWays(s, d, m);%0A        System.out.println(result);%0A    %7D%0A%7D%0A

add BirthdayCake.java