Jump to content

New Problem


fake_Bezawada

Recommended Posts

4 minutes ago, icecreamZ said:

post problem here....vaadu bio data / ssn / aasthi vivaralu anni aduguthunnadu

sign in with gmail anthe gada migathavi skip kotti chudu uncle adoka pedda page vundhi veyyalenu

Link to comment
Share on other sites

5 minutes ago, fake_Bezawada said:

sign in with gmail anthe gada migathavi skip kotti chudu uncle adoka pedda page vundhi veyyalenu

dhani tharvateh profile fill antundhi...mobile number kooda kavali anta.

Link to comment
Share on other sites

55 minutes ago, BaabuBangaram said:

bro chaala easy adhi....contest ayipoyaka solution evado okadu post chesthadu appudu chusuko

solution chusukunetlu aythe naku endhuko ee lopu solution nenu cheyali ani kadha

Link to comment
Share on other sites

6 minutes ago, fake_Bezawada said:

solution chusukunetlu aythe naku endhuko ee lopu solution nenu cheyali ani kadha

hmmm simple gaane vundhi chusthe....but cheyadaniki naaku interest raavadam ledhu....motivation ledhu vayya basical ga

Link to comment
Share on other sites

3 minutes ago, BaabuBangaram said:

hmmm simple gaane vundhi chusthe....but cheyadaniki naaku interest raavadam ledhu....motivation ledhu vayya basical ga

brillaint fellow nakosam cheyachu ga osari

Link to comment
Share on other sites

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class TestClass {
   public static void main(String[] args) throws IOException {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String lineOne=br.readLine();
        String[] NM=lineOne.split("\\s+");
        Integer mValue=new Integer(NM[1]);
        int mFactor=2*mValue+1;
        int[][] fFactor=new int[mFactor][mFactor];
        int[][] nValues=new int[Integer.parseInt(NM[0])][Integer.parseInt(NM[0])];
        //fFactor
        for(int i=0;i<mFactor;i++){
            String input=br.readLine();
            String[] fIntake=input.split("\\s+");
            for(int j=0;j<mFactor;j++){
                fFactor[j]=Integer.parseInt(fIntake[j]);
            }
        }
        //actual Values
        for(int i=0;i<Integer.parseInt(NM[0]);i++){
            String input=br.readLine();
            String[] nIntake=input.split("\\s+");
            for(int j=0;j<Integer.parseInt(NM[0]);j++){
                nValues[j]=Integer.parseInt(nIntake[j]);
            }
        }
        doProcess(fFactor,nValues);
    }

    private static void doProcess(int[][] fFactor, int[][] nValues) {
        int matrixFactor=fFactor.length/2;
        for(int i=0;i<nValues.length;i++){    
            for(int j=0;j<nValues.length;j++){
                int finValue=0;

                int mMax=i+matrixFactor;
                int kMax=j+matrixFactor;
                for(int m=i-matrixFactor,p=0;(m<=mMax&&p<fFactor.length);m++,p++){
                    for(int k=j-matrixFactor,n=0;(k<=kMax&&n<fFactor.length);k++,n++){
                        if((m<0||k<0)||(m>nValues.length-1||k>nValues.length-1)){
                            finValue+=(fFactor[p][n]*0);
                        }else{
                            finValue+=(fFactor[p][n]*nValues[m][k]);
                            
                        }
                    }
                   
                }
                System.out.print(finValue+" ");        
            }
            System.out.println(); 
        }

    }
}
 

Link to comment
Share on other sites

6 minutes ago, karthikn said:

Cool.. Hacker rank tho paatu Hacker Earth bhi chusthunta

Ah sites lo kondaru programmers chusthe shock avtuna bro just studying btech but multiple languages lo chestaru edaina Manchi college lo chadivithe ah quality ae veru masters ayna correct course work chesthe manalu iraga teestaru

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...