#include <bits/stdc++.h>

using namespace std;

int helmper(int b,int n){
    vector<vector<int>> v;
    int z=n;
    int q=n/b,r=n%b,t1=0,t2=1,t3=t1-q*t2;
    vector<int> temp(7);
         //****
        temp[0]=n;
        temp[1]=b;
        temp[2]=q;
        temp[3]=r;
        temp[4]=t1;
        temp[5]=t2;
        temp[6]=t3;
        v.push_back(temp);
        //****
    
    while(r!=0){
       
        n=b;
        b=r;
        t1=t2;
        t2=t3;
        q=n/b;
        r=n%b;
        t3=t1-t2*q;
        
         //****
        temp[0]=n;
        temp[1]=b;
        temp[2]=q;
        temp[3]=r;
        temp[4]=t1;
        temp[5]=t2;
        temp[6]=t3;
        v.push_back(temp);
        //****
    }
    int s1=v.size();
    for(int i=0;i<s1;i++){
        for(int j=0;j<7;j++){
            cout<<v[i][j]<<" ";
        }
        cout<<endl;
    }
    if(t2<0) t2=t2+z;
    return t2;
}

int main()
{
    // cout<<"Hello World";
    int a=11;
    int b=26;
    int ans=helmper(11,26);
    cout<<ans<<endl;
    return 0;
}


//references : lecture ppts and https://[Log in to view URL]  

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: