/*
praktiskais darbs 5
Edgars Ševčuks
110 lietoju onlinegdb
*/
using System;


    class  Program
    {
        static void Main(string[] args)
        {

            int[,] masivs = {
                { 1, 2 },
                {5, 6, 7 },
                {9 }
            };
            for (int i = 0; i < 3; i++) 
            {
                
                for (int j = 0; j < 4; j++) 
                {
                    Console.Write(masivs[i, j]+ " ");
                   
                }
                Console.WriteLine();
            }
        }            
    }

2uzd
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


    class  Program
    {
        static void Main(string[] args)
        {

            int[][] masivs = {
                new int[]{ 1, 2 },
                new int[]{5, 6, 7 },
                new int[]{9 }
            };
            for (int i = 0; i < 3; i++) 
            {
                
                for (int j = 0; j < masivs[i].Length; j++) 
                {
                    Console.Write(masivs[i][j]+ " ");
                }
                    
                Console.WriteLine();
            }
        }            
    }

3 uzd
using System;


    class  Program
    {
        static void Main(string[] args)
        {

            int[,] masivs = {
                { 1, 2, 7, 6 },
                {5, 6, 7, 5 },
                {9, 8, 8, 5},
                {5, 6, 7, 5 },
                {5, 6, 9, 5 }
            };
            for (int i = 0; i < masivs.GetLength(0); i++) 
            {
                int summa = 0;
                for (int j = 0; j < masivs.GetLength(1); j++) 
                {
                    summa += masivs[i, j];
                    Console.Write(masivs[i, j]+ " ");
                }
                    
                Console.WriteLine(summa);
            }
        }            
    }



4 uzd
using System;


    class  Program
    {
        static void Main(string[] args)
        {

            int[,] masivs = {
                { 1, 2, 3 },
                {4, 5, 6 },
                {7, 8, 9},
                
            };
            int a = Convert.ToInt32(Console.ReadLine());
            
            for (int i = 0; i < masivs.GetLength(0); i++) 
            {
                int summa = 0;
                for (int j = 0; j < masivs.GetLength(1); j++) 
                {
                    summa += masivs[i, j];
                    if(a == masivs [i, j])
                    {
                        Console.WriteLine("indeks "+i+";"+j);
                    }
                }
                    
                Console.WriteLine(summa);
            }
        }            
    }