Sunday 30 December 2012

Uninstall Babylon and Babylon toolbar completely


Uninstall Babylon from your system

Open Add or remove programs to uninstall Babylon from your system
  1. Start  → Control Panel → Programs →Uninstall a program.
  2. In the Add or remove programs list search for Babylon then double click on it to uninstall it.

    The Babylon uninstaller will start and you'll see a prompt, like the one below from which you will need to select 'Uninstall'.
  3. After the Babylon uninstall process has completed , in the Add or remove programs list search for Babylon toolbar on IE and then double click on it to uninstall it.


Remove the Babylon residual damage from your browser
  • From Internet Explorer 

    1. Open Internet Explorer add-on manager
      For Internet Explorer 9 : Click on the gear icon [Image: icongear.jpg] at the top (far right) and click again on Manage add-ons.
    2. For Internet Explorer 8 : Click on Tools, select Manage Add-ons.
    3. Select Toolbars and Extensions and disable everything related to Babylon Ltd. from the list (eg : Babylon toolbar, Babylon toolbar helper, Babylon IE plugin, babylonToolbar.com)
    4. Next,select Search Providers and click on Bing and chose 'Set as default 'to make this search engine your default search provider.

      Then select Search the web (Babylon) and click the Remove button to uninstall it.
    5. Click on the gear icon [Image: icongear.jpg] at the top (far right) (Tools for Windows XP users) and click again on Internet Options.In the General tab in theHome Page section enter your favorite website instead of search.babylon.com and then click Apply and OK to save the changes.

  • From Mozilla Firefox 
    1. Open Firefox and click on Firefox from the upper left corner  , then select Add-ons
    2. From the Add-on manager, select Extensions and remove everything related to Babylon Ltd. from the list (eg : Babylon , Babylon Speller and Proofreading, Babylon Translate Activation) then restart your browser.
    3. On the main window of Firefox , click the small magnifier icon at the right top corner as shown in the image below and select Manage Search Engines.

      In the new window, select Search the web (Babylon) and click on Remove and then chose your favorite search engine.Press OK to apply the changes.
    4. Open Firefox and click on Firefox from the upper left corner  , then select Options.In the General tab in the Home Page section enter your favorite website instead of search.babylon.com and then click OK to save the changes.
  • From Google Chrome 

    1. Open Google Chrome and click on the wrench icon [Image: chrome_toolsmenu.gif] on the browser toolbar.Click Tools and then select Extensions.
    2. In the Extensions tab, Remove everything related to Babylon Ltd. from the list (eg : Babylon Translator ) then restart your browser.
    3. Click the wrench icon [Image: chrome_toolsmenu.gif] on the browser toolbar.Select Options, then click the Basics tab and click on Manage search engines in the"Search" section. Select Search the web (Babylon) from the list and click the X that appears at the end of the row then select Google from the list and make it your default search engine.
    4. Click the wrench icon [Image: chrome_toolsmenu.gif] on the browser toolbar.Select Options, then click the Basics tab. In the Home Page section enter your favorite website instead of search.babylon.com
  • Sunday 16 December 2012

    show hidden data in your pen-drive

    Sometimes you have data in your pendrive but windows explorer dont show anything. 
    The problem could be because all the data that was present inside the pen drive now have become system files by the virus. This is the reason why they are not visible even with the option “Show Hidden files and folders”.
    To remove the problem this is what you need to do.
    1. Go to Folder Options -> View tab
    2. Make sure that your Show Hidden files and folders option is enabled.
    3. Uncheck the option that reads “Hide protected operating system files (recommended)”


    Now when you see your pen drive, you will find that your data is present there but in hidden form. There are 2 ways to unhide the data, either right click and uncheck the Hidden box or type in the following command in the command prompt
    attrib filename –h –r –s
    where filename is the complete location of the file.

    Tuesday 4 December 2012

    Some Important Website-: Owner

    ● Google - : Sergey Brin, Larry Page

    ● Facebook - : Mark Zuckerberg, Dustin Moskovitz, Chris Hughes, Eduardo Saverin

    ● Wikipedia - : Jimmy Wales, Larry Sanger

    ● Youtube - : Steve Chen, Chad Hurley, Jawed Karim

    ● Twitter - : Evan Williams, Biz Stone, Jack Dorsey

    ● eBay - : Pierre Omidyar

    ● Orkut - : Orkut Buyukkokten

    ● MySpace - : Tom Anderson, Chris DeWolfe

    ● Friendster - : Jonathan Abrams

    ● Yahoo - : David Filo, Jerry Yang

    ● Hotmail - : Sabeer Bhatia

    ● Wikileaks - : Julian Assange

    ● Nimbuzz - : Evert Jaap Lugt

    Thursday 22 November 2012

    Oracle 11g: Install+Login+Uninstall

    Installation 
    Step 1:
    its better to create a drive (>10GB) for Oracle.

    Step 2:
    run the oracle 11g setup file, then u will see the picture, check 'Advanced Installation', then click 'Next'.


    Step 3: Click 'Next' (Enterprise Edition is checked default)


    Step 4:
    Change installation location, i have created a new drive I, and replace C to I in default directory of Oracle base. Path will be automatically Changed. Click 'Next'.


    Step 5:
    Check all that is not checked automatically. Click 'Next'.


    Step 6:
    Click 'Next'. (Create Database is auto selected)
     

    Step 7:
    Click 'Next'. (General Purpose / Transaction Processing is selected by default)

    Step 8:
    Click 'Next'. (both text-box are filled with 'orcl' by default.

     Step 9:
    Click 'Sample Schemas' tab, check 'create database with sample schemas', Click 'Next'.


    Step 10:
    Click 'Next'.


    Step 11:
    Click 'Next'.


    Step 12:
    Click 'Next'.

    Step 13:
    check 'use the same password for all account'. then enter and confirm your password (dont forget the password). Click 'Next'.


    Step 14:
    Click 'Next'.

    Step 15:
    Click 'Install'. (if u see 132 product in New installation, then you are done)
     

    Step 16:
    Nothing to do :), just watch.


    Step 17:
    Nothing to do :), just watch.


    Step 18:
    Nothing to do :), just watch.

    Step 19:
    its better to screenshot this page, u need 'The Database Control URL' to login with OEM (Oracle Enterprise Management)
    Click on 'Password Management'.


    Step 20:
    uncheck 'Lock Account' under 'SCOTT'. click 'ok'.
     

    Step 21:
    click 'exit'.
    you have finished installing successfully.... :)



    Login
    there are several login progcess for oracle, the most two common process are:

    Process 1.
     go to your Database Control URL. if you forgot to save the link while installing, don't worry, the link is
    https://ip:1158/em or https://host name:1158/em
    here, ip is your ip address and host name your host name, you can find your ip/host name writing ipconfig/all in cmd.
    use SYS or SYSTEM as your user name.

    Process 2:
    start>SQL plus. then enter username and password
    use SYS or SYSTEM as your user name.


    Uninstall
    Step1:
    goto start>Universal Installer. click 'Deinstall Products'.


    Step 2:
    mark all check boxes. (to uninstall completely). Click 'Remove'.


    Step 3:
    Click 'Yes'.


    Step 4:
    Click 'Yes'.
     Step 5:
    click 'Close'.

     now you have successfully uninstalled Oracle 11g from your computer.
    its better to format your oracle drive.



    Sunday 28 October 2012

    computer and internet related some abbreviation

    HTTP --> Hyper Text Transfer Protocol
    HTML --> Hyperlink Text Markup Language
    IP --> Internet Protocol

    APN --> Access Point Name
    ATM --> Automated Teller Machine
    BIOS --> Basic Input Output System
    CD --> Compact Disc
    VCD --> Video Compact Disc
    CDR --> Compact Disc Recorder
    DVD --> Digital Versatile Disc
    FDD --> Floppy Disk Drive
    HDD --> Hard Disk Drive
    JAR --> Java Archive
    JAD --> Java Description/Descriptors
    LAN --> Local Area Network
    LCD --> Liquid Crystal Display
    LED --> Light Emitting Diode
    PIN --> Personal Identity Number
    PDF --> Portable Document Format
    RAM --> Random Access Memory
    ROM --> Read-Only Memory
    SIM --> Subscriber Identity Module
    USB --> Universal Serial Bus
    URL --> Uniform Resource Location
    www --> World Wide Web
    WAN --> Wide Area Network
    WAP --> Wireless Application Protocol

    UVa 10104 - Euclid Problem Solution

    #include<iostream>
    #include<cstdio>
    #include<list>
    #include<string>
    #include<cstring>
    #include<sstream>
    #include<cctype>
    #include<string.h>
    #include<algorithm>
    #include<cmath>
    #include<stack>
    #include<fstream>
    #include<cstdlib>
    #include<vector>
    #include<map>
    #include<set>
    #include<utility>
    #include<iomanip>
    #include<queue>
    #include<deque>
    #include<iterator>
    #include<assert.h>
    #include<bitset>
    #include<climits>
    #include<ctime>
    #include<complex>

    using namespace std;

    #define SET(a) memset(a,-1,sizeof(a))
    #define ALL(a) a.begin(),a.end()
    #define CLR(a) memset(a,0,sizeof(a))
    #define PB push_back
    #define PI acos(-1.0)
    #define MP(a,b) make_pair(a,b)
    #define PII pair<int,int>
    #define PCC pair<char,char>
    #define PIC pair<int,char>
    #define PCI pair<char,int>
    #define VS vector<string>
    #define VI vector<int>
    #define VC vector<char>
    #define max3(a,b,c) max(a,max(b,c)
    #define min3(a,b,c) min(a,min(b,c)
    #define READ freopen("input.txt", "r", stdin)
    #define WRITE freopen("output.txt", "w", stdout)
    #define LL long long
    #define FOR(i,a,b) for(int i=a;i<=b;i++)
    #define RFOR(i,a,b) for(int i=a;i>=b;i--)
    #define For(i,a) for(int i=0;i<a;i++)

    #define S(a) scanf("%d",&a)
    #define S2(a,b) scanf("%d%d",&a,&b)
    #define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
    #define SLL(a) scanf("%lld",&a)
    #define SLL2(a,b) scanf("%lld%lld",&a,&b)
    #define SLL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
    #define SS(a) scanf("%s",a)
    #define SC(a) scanf("%c",&a)
    #define SD(a) scanf("%lf",&a)
    #define P(a) printf("%d",a)
    #define PLL(a) printf("%lld",a)
    #define PD(a) printf("%lf",a)
    #define PC(a) printf("%c",a)
    #define PS(a) printf("%s",a)
    #define KS printf("Case %d: ",kk++)
    #define KN printf("Case %d:\n",kk++)
    #define KH printf("Case #%d: ",kk++)
    #define NL printf("\n")
    #define DB cout<<"done"<<endl;

    #define EPS 1e-9
    #define MOD 10007
    #define INF INT_MAX/3
    #define MX 1010

    template<typename T>inline string tostring(T a){ostringstream os("");os << a;return os.str();}
    template<typename T>inline LL tolong(T a){LL res;istringstream os(a);os>>res;return res;}
    template<typename T>inline VI parse(T str){VI res;int s;istringstream os(str);while(os>>s)res.PB(s);return res;}
    template< class T > inline T _sqrt(T x) { return (T) sqrt( (double) x); }
    template< class T > inline T _bigmod(T n,T m) {T ans=1,mult=n%MOD; while(m){ if(m & 1) ans=(ans*mult)%MOD; m>>=1; mult=(mult*mult)%MOD; } ans%=MOD; return ans;}
    template< class T > inline T _modinv(T x) {return _bigmod(x,(T) MOD-2)%MOD;}
    inline int LEN(string a) {return a.length();}
    inline int LEN(char a[]) {return strlen(a);}
    template< class T > inline T __lcm(T x,T y) { return x*y/__gcd(x,y);}


    vector<LL> Extended_Euclid(int a, int b)
    {
        LL last_x=1,last_y=0,x=0,y=1,tmp,quotient,reminder;
        while(b)
        {
            quotient=a/b;
            reminder=a%b;
            a=b;
            b=reminder;

            tmp=x;
            x=last_x-quotient*x;
            last_x=tmp;

            tmp=y;
            y=last_y-quotient*y;
            last_y=tmp;
        }
        vector<LL>res;
        res.PB(last_x);
        res.PB(last_y);
        res.PB(a);
    return res;
    }
    int main()
    {
        LL a,b;
        while(cin>>a>>b)
        {
            vector<LL>res=Extended_Euclid(a,b);
            cout<<res[0]<<" "<<res[1]<<" "<<res[2]<<endl;
        }
    return 0;
    }

    Friday 26 October 2012

    Bitset built-in Function

    #include<iostream>
    #include<bitset>
     
    using namespace std;
     
    int main()
    {
            for(int x; cin >> x; puts(""))
            {
                    cout << bitset<32>(x) << endl;
                    cout << "Number of set bits in given number: " << __builtin_popcount(x) << endl;
                    cout << "Number of leading zeroes: " << __builtin_clz(x) << endl;
                    cout << "Number of trailing zeroes: " << __builtin_ctz(x) << endl;
                    cout << "Length of binary representation of given number: " << 32-__builtin_clz(x) << endl;
            }
            return 0;
    }
     
     
     
     
    input: 10
    output:
    00000000000000000000000001100100
    Number of set bits in given number: 3
    Number of leading zeroes: 25
    Number of trailing zeroes: 2
    Length of binary representation of given number: 7 

    Thursday 25 October 2012

    Spoj 6471. Printing some primes Solution

    #include<iostream>
    #include<cstdio>
    #include<list>
    #include<string>
    #include<cstring>
    #include<sstream>
    #include<cctype>
    #include<string.h>
    #include<algorithm>
    #include<cmath>
    #include<stack>
    #include<fstream>
    #include<cstdlib>
    #include<vector>
    #include<map>
    #include<set>
    #include<utility>
    #include<iomanip>
    #include<queue>
    #include<deque>
    #include<iterator>
    #include<assert.h>
    #include<bitset>
    #include<climits>
    #include<ctime>
    #include<complex>

    using namespace std;

    #define SET(a) memset(a,-1,sizeof(a))
    #define ALL(a) a.begin(),a.end()
    #define CLR(a) memset(a,0,sizeof(a))
    #define PB push_back
    #define PI acos(-1.0)
    #define MP(a,b) make_pair(a,b)
    #define PII pair<int,int>
    #define PCC pair<char,char>
    #define PIC pair<int,char>
    #define PCI pair<char,int>
    #define VS vector<string>
    #define VI vector<int>
    #define VC vector<char>
    #define max3(a,b,c) max(a,max(b,c)
    #define min3(a,b,c) min(a,min(b,c)
    #define READ freopen("input.txt", "r", stdin)
    #define WRITE freopen("output.txt", "w", stdout)
    #define LL long long
    #define FOR(i,a,b) for(int i=a;i<=b;i++)
    #define RFOR(i,a,b) for(int i=a;i>=b;i--)
    #define For(i,a) for(int i=0;i<a;i++)

    #define S(a) scanf("%d",&a)
    #define S2(a,b) scanf("%d%d",&a,&b)
    #define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
    #define SLL(a) scanf("%lld",&a)
    #define SLL2(a,b) scanf("%lld%lld",&a,&b)
    #define SLL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
    #define SS(a) scanf("%s",a)
    #define SC(a) scanf("%c",&a)
    #define SD(a) scanf("%lf",&a)
    #define P(a) printf("%d",a)
    #define PLL(a) printf("%lld",a)
    #define PD(a) printf("%lf",a)
    #define PC(a) printf("%c",a)
    #define PS(a) printf("%s",a)
    #define KS printf("Case %d: ",kk++)
    #define KN printf("Case %d:\n",kk++)
    #define KH printf("Case #%d: ",kk++)
    #define NL printf("\n")
    #define DB cout<<"done"<<endl;

    #define EPS 1e-9
    #define MOD 10007
    #define INF INT_MAX/3
    #define MX 100000000

    template<typename T>inline string tostring(T a){ostringstream os("");os << a;return os.str();}
    template<typename T>inline LL tolong(T a){LL res;istringstream os(a);os>>res;return res;}
    template<typename T>inline VI parse(T str){VI res;int s;istringstream os(str);while(os>>s)res.PB(s);return res;}
    template< class T > inline T _sqrt(T x) { return (T) sqrt( (double) x); }
    template< class T > inline T _bigmod(T n,T m) {T ans=1,mult=n%MOD; while(m){ if(m & 1) ans=(ans*mult)%MOD; m>>=1; mult=(mult*mult)%MOD; } ans%=MOD; return ans;}
    template< class T > inline T _modinv(T x) {return _bigmod(x,(T) MOD-2)%MOD;}
    inline int LEN(string a) {return a.length();}
    inline int LEN(char a[]) {return strlen(a);}
    template< class T > inline T __lcm(T x,T y) { return x*y/__gcd(x,y);}


    bool Check(int N,int pos){return (bool)(N & (1<<pos));}
    int Set(int N,int pos){ return N | (1<<pos);}

    int status[(MX/32)+2];
    void sieve()
    {
         int i, j, sqrtN,cnt=0;
         sqrtN = int( sqrt( MX ) );
         printf("2\n");
         cnt++;
         for( i = 3; i <= sqrtN; i += 2 )
            //if( Check(status[i>>5],i&31)==0)
            if(!(status[i>>5] & (1<<(i&31))))
            {
                if(!(cnt%100))  printf("%d\n",i);
                cnt++;
                for( j = i*i; j <= MX; j += (i<<1) )
                    //status[j>>5]= Set(status[j>>5],j & 31);
                    status[j>>5]= status[j>>5] | (1<<(j&31));
            }

         for(i=sqrtN+1;i<=MX;i+=2)
             //if( Check(status[i>>5],i&31)==0)
             if(!(status[i>>5] & (1<<(i&31))))
             {
                 if(!(cnt%100))  printf("%d\n",i);
                 cnt++;
             }
        return;
    }
    int main()
    {
        sieve();
    return 0;
    }

    Monday 22 October 2012

    UVa 11151 - Longest Palindrome Solution

    #include<iostream>
    #include<cstdio>
    #include<list>
    #include<string>
    #include<cstring>
    #include<sstream>
    #include<cctype>
    #include<string.h>
    #include<algorithm>
    #include<cmath>
    #include<stack>
    #include<fstream>
    #include<cstdlib>
    #include<vector>
    #include<map>
    #include<set>
    #include<utility>
    #include<iomanip>
    #include<queue>
    #include<deque>
    #include<iterator>
    #include<assert.h>
    #include<bitset>
    #include<climits>
    #include<ctime>
    #include<complex>

    using namespace std;

    #define SET(a) memset(a,-1,sizeof(a))
    #define ALL(a) a.begin(),a.end()
    #define CLR(a) memset(a,0,sizeof(a))
    #define PB push_back
    #define PI acos(-1.0)
    #define MP(a,b) make_pair(a,b)
    #define PII pair<int,int>
    #define PCC pair<char,char>
    #define PIC pair<int,char>
    #define PCI pair<char,int>
    #define VS vector<string>
    #define VI vector<int>
    #define VC vector<char>
    #define max3(a,b,c) max(a,max(b,c)
    #define min3(a,b,c) min(a,min(b,c)
    #define READ freopen("input.txt", "r", stdin)
    #define WRITE freopen("output.txt", "w", stdout)
    #define LL long long
    #define FOR(i,a,b) for(int i=a;i<=b;i++)
    #define RFOR(i,a,b) for(int i=a;i>=b;i--)
    #define For(i,a) for(int i=0;i<a;i++)

    #define S(a) scanf("%d",&a)
    #define S2(a,b) scanf("%d%d",&a,&b)
    #define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
    #define SLL(a) scanf("%lld",&a)
    #define SLL2(a,b) scanf("%lld%lld",&a,&b)
    #define SLL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
    #define SS(a) scanf("%s",a)
    #define SC(a) scanf("%c",&a)
    #define SD(a) scanf("%lf",&a)
    #define P(a) printf("%d",a)
    #define PLL(a) printf("%lld",a)
    #define PD(a) printf("%lf",a)
    #define PC(a) printf("%c",a)
    #define PS(a) printf("%s",a)
    #define KS printf("Case %d: ",kk++)
    #define KN printf("Case %d:\n",kk++)
    #define KH printf("Case #%d: ",kk++)
    #define NL printf("\n")
    #define DB cout<<"done"<<endl;

    #define EPS 1e-9
    #define MOD 10007
    #define INF INT_MAX/3
    #define MX 1010

    template<typename T>inline string tostring(T a){ostringstream os("");os << a;return os.str();}
    template<typename T>inline LL tolong(T a){LL res;istringstream os(a);os>>res;return res;}
    template<typename T>inline VI parse(T str){VI res;int s;istringstream os(str);while(os>>s)res.PB(s);return res;}
    template< class T > inline T _sqrt(T x) { return (T) sqrt( (double) x); }
    template< class T > inline T _bigmod(T n,T m) {T ans=1,mult=n%MOD; while(m){ if(m & 1) ans=(ans*mult)%MOD; m>>=1; mult=(mult*mult)%MOD; } ans%=MOD; return ans;}
    template< class T > inline T _modinv(T x) {return _bigmod(x,(T) MOD-2)%MOD;}
    inline int LEN(string a) {return a.length();}
    inline int LEN(char a[]) {return strlen(a);}
    template< class T > inline T __lcm(T x,T y) { return x*y/__gcd(x,y);}

    char s[1010];
    int dp[1010][1010];
    int Longest_Palindrome(int lft, int rgt)
    {
        if(lft==rgt)    return 1;
        if(lft>rgt) return 0;

        if(dp[lft][rgt]!=-1)    return dp[lft][rgt];

        int ret=0;
        if(s[lft]==s[rgt])
            ret=Longest_Palindrome(lft+1,rgt-1)+2;
        else
            ret=max(Longest_Palindrome(lft+1,rgt),Longest_Palindrome(lft,rgt-1));

    return dp[lft][rgt]=ret;
    }

    int main()
    {
        int tc,kk=1,n,m;
        cin>>tc;
        cin.getline(s,1010);
        while(tc--)
        {
            cin.getline(s,1010);
            int sl=LEN(s);
            SET(dp);
            cout<<Longest_Palindrome(0,sl-1)<<endl;
        }

    return 0;
    }

    Saturday 20 October 2012

    Compile and Run .java file using CMD_ Windows 7

    First of all, u need java JDK install in your PC. I m showing the example for jdk1.7.0_07 installed in my PC.
    Then you need to set PATH and CLASS to set....
    right click on My Computer>>Properties>>Advance System Settings. 
    in 'Advanced' tab click on 'Environment variable'
    now on 'System Variable' window click on new after that a window will opened in which give
     variable name = PATH and variable value = C:\Program Files\Java\jdk1.7.0_07\bin
    press OK
    on "Users Variable" window, Click on new and give the following value..
    variable name = CLASS and variable value =C:\Program Files\Java\jdk1.7.0_07\lib

    now your PATH and CLASS is ready.... :)

    compile and run:-
    lets have a Example: (do same with me)
    i write this code:

    public class Welcome{
        public static void main(String[] args){
        System.out.println("Welcome To Java!");
        }
    }

    ans saved it as 'Welcome.java' to a folder named jva in D drive....
    now open cmd and do the following

    D: (enter)

    cd\jva (enter)
    javac Welcome.java //now your code compiled
    java Welcome        //run your code......

    now you are done.......




    d

    Friday 19 October 2012

    UVa 12511 - Virus Solution

    #include<iostream>
    #include<cstdio>
    #include<list>
    #include<string>
    #include<cstring>
    #include<sstream>
    #include<cctype>
    #include<string.h>
    #include<algorithm>
    #include<cmath>
    #include<stack>
    #include<fstream>
    #include<cstdlib>
    #include<vector>
    #include<map>
    #include<set>
    #include<utility>
    #include<iomanip>
    #include<queue>
    #include<deque>
    #include<iterator>
    #include<assert.h>
    #include<bitset>
    #include<climits>
    #include<ctime>
    #include<complex>
    
    using namespace std;
    
    #define SET(a) memset(a,-1,sizeof(a))
    #define ALL(a) a.begin(),a.end()
    #define CLR(a) memset(a,0,sizeof(a))
    #define PB push_back
    #define PI acos(-1.0)
    #define MP(a,b) make_pair(a,b)
    #define PII pair<int,int>
    #define PCC pair<char,char>
    #define PIC pair<int,char>
    #define PCI pair<char,int>
    #define VS vector<string>
    #define VI vector<int>
    #define VC vector<char>
    #define max3(a,b,c) max(a,max(b,c)
    #define min3(a,b,c) min(a,min(b,c)
    #define READ freopen("input.txt", "r", stdin)
    #define WRITE freopen("output.txt", "w", stdout)
    #define LL long long
    #define FOR(i,a,b) for(int i=a;i<=b;i++)
    #define RFOR(i,a,b) for(int i=a;i>=b;i--)
    #define For(i,a) for(int i=0;i<a;i++)
    
    #define S(a) scanf("%d",&a)
    #define S2(a,b) scanf("%d%d",&a,&b)
    #define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
    #define SLL(a) scanf("%lld",&a)
    #define SLL2(a,b) scanf("%lld%lld",&a,&b)
    #define SLL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
    #define SS(a) scanf("%s",a)
    #define SC(a) scanf("%c",&a)
    #define SD(a) scanf("%lf",&a)
    #define P(a) printf("%d",a)
    #define PLL(a) printf("%lld",a)
    #define PD(a) printf("%lf",a)
    #define PC(a) printf("%c",a)
    #define PS(a) printf("%s",a)
    #define KS printf("Case %d: ",kk++)
    #define KN printf("Case %d:\n",kk++)
    #define KH printf("Case #%d: ",kk++)
    #define NL printf("\n")
    #define DB cout<<"done"<<endl;
    
    #define EPS 1e-9
    #define MOD 1000000007
    #define INF INT_MAX/3
    #define MX 1010
    
    template<typename T>inline string tostring(T a){ostringstream os("");os << a;return os.str();}
    template<typename T>inline LL tolong(T a){LL res;istringstream os(a);os>>res;return res;}
    template<typename T>inline VI parse(T str){VI res;int s;istringstream os(str);while(os>>s)res.PB(s);return res;}
    template< class T > inline T _sqrt(T x) { return (T) sqrt( (double) x); }
    template< class T > inline T _bigmod(T n,T m) {T ans=1,mult=n%MOD; while(m){ if(m & 1) ans=(ans*mult)%MOD; m>>=1; mult=(mult*mult)%MOD; } ans%=MOD; return ans;}
    template< class T > inline T _modinv(T x) {return _bigmod(x,(T) MOD-2)%MOD;}
    inline int LEN(string a) {return a.length();}
    inline int LEN(char a[]) {return strlen(a);}
    template<class T> inline T _gcd(T a, T b){return (b.chk()==0) ? a : _gcd(b, a % b);}
    template< class T > inline T _lcm(T x,T y) { return x*y/_gcd(x,y);}
    
    int arr[MX],arr2[MX],C[MX],prev[MX],N,M;
    void LCIS()
    {
        CLR(C);
        int cur,last;
        For(i,N)
        {
            cur=0;last=-1;
            For(j,M)
            {
                if (arr[i]==arr2[j] && cur>=C[j])
                {
                   C[j]=cur+1;
                   prev[j]=last;
                }
                if (arr[i]>arr2[j] && cur<C[j])
                {
                   cur=C[j];
                   last=j;
                }
            }
        }
    
        int length=0,index=-1;
        For(i,M)
            if (C[i]>length)
            {
                length=C[i];
                index=i;
            }
        cout<<length<<endl;
        /*printf("The length of LCIS is %d\n",length);
        if (length>0)
        {
            printf("The LCIS is \n");
            while (index!=-1)
            {
                res.push_back(arr2[index]);
                index=prev[index];
            }
            reverse(res.begin(),res.end());
            for (i=0;i<length;i++)
                printf("%d%s",res[i],i==length-1?"\n":" ");
         }*/
    return;
    }
    int main()
    {
        int tc,kk=1;
        cin>>tc;
        while(tc--)
        {
            cin>>N;
            For(i,N)
                cin>>arr[i];
            cin>>M;
            For(i,M)
                cin>>arr2[i];
            LCIS();
        }
    
    return 0;
    }

    UVa 12506 - Shortest Names Solution

    #include<iostream>
    #include<cstdio>
    #include<list>
    #include<string>
    #include<cstring>
    #include<sstream>
    #include<cctype>
    #include<string.h>
    #include<algorithm>
    #include<cmath>
    #include<stack>
    #include<fstream>
    #include<cstdlib>
    #include<vector>
    #include<map>
    #include<set>
    #include<utility>
    #include<iomanip>
    #include<queue>
    #include<deque>
    #include<iterator>
    #include<assert.h>
    #include<bitset>
    #include<climits>
    #include<ctime>
    #include<complex>
    
    using namespace std;
    
    #define SET(a) memset(a,-1,sizeof(a))
    #define ALL(a) a.begin(),a.end()
    #define CLR(a) memset(a,0,sizeof(a))
    #define PB push_back
    #define PI acos(-1.0)
    #define MP(a,b) make_pair(a,b)
    #define PII pair<int,int>
    #define PCC pair<char,char>
    #define PIC pair<int,char>
    #define PCI pair<char,int>
    #define VS vector<string>
    #define VI vector<int>
    #define VC vector<char>
    #define max3(a,b,c) max(a,max(b,c)
    #define min3(a,b,c) min(a,min(b,c)
    #define READ freopen("input.txt", "r", stdin)
    #define WRITE freopen("output.txt", "w", stdout)
    #define LL long long
    #define FOR(i,a,b) for(int i=a;i<=b;i++)
    #define RFOR(i,a,b) for(int i=a;i>=b;i--)
    #define For(i,a) for(int i=0;i<a;i++)
    
    #define S(a) scanf("%d",&a)
    #define S2(a,b) scanf("%d%d",&a,&b)
    #define S3(a,b,c) scanf("%d%d%d",&a,&b,&c)
    #define SLL(a) scanf("%lld",&a)
    #define SLL2(a,b) scanf("%lld%lld",&a,&b)
    #define SLL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
    #define SS(a) scanf("%s",a)
    #define SC(a) scanf("%c",&a)
    #define SD(a) scanf("%lf",&a)
    #define P(a) printf("%d",a)
    #define PLL(a) printf("%lld",a)
    #define PD(a) printf("%lf",a)
    #define PC(a) printf("%c",a)
    #define PS(a) printf("%s",a)
    #define KS printf("Case %d: ",kk++)
    #define KN printf("Case %d:\n",kk++)
    #define KH printf("Case #%d: ",kk++)
    #define NL printf("\n")
    #define DB cout<<"done"<<endl;
    
    #define EPS 1e-9
    #define MOD 1000000007
    #define INF INT_MAX/3
    #define MX 100010
    
    template<typename T>inline string tostring(T a){ostringstream os("");os << a;return os.str();}
    template<typename T>inline LL tolong(T a){LL res;istringstream os(a);os>>res;return res;}
    template<typename T>inline VI parse(T str){VI res;int s;istringstream os(str);while(os>>s)res.PB(s);return res;}
    template< class T > inline T _sqrt(T x) { return (T) sqrt( (double) x); }
    template< class T > inline T _bigmod(T n,T m) {T ans=1,mult=n%MOD; while(m){ if(m & 1) ans=(ans*mult)%MOD; m>>=1; mult=(mult*mult)%MOD; } ans%=MOD; return ans;}
    template< class T > inline T _modinv(T x) {return _bigmod(x,(T) MOD-2)%MOD;}
    inline int LEN(string a) {return a.length();}
    inline int LEN(char a[]) {return strlen(a);}
    template<class T> inline T _gcd(T a, T b){return (b.chk()==0) ? a : _gcd(b, a % b);}
    template< class T > inline T _lcm(T x,T y) { return x*y/_gcd(x,y);}
    
    //char ss[1010][1000010];
    int main()
    {
        int tc,kk=1,n,m;
        string s[1010],tmp;
        cin>>tc;
        while(tc--)
        {
            cin>>n;
            int scnt=0;
            For(i,n)
                cin>>s[i];
            sort(s,s+n);
            int cnt=0;
            int pos=0;
            int pos2=0;
            while(s[0][pos]==s[1][pos])
                pos++;
    
            cnt+=pos+1;
            pos=0;
            while(s[n-1][pos]==s[n-2][pos])
                pos++;
    
            cnt+=pos+1;
            //cout<<cnt<<endl;
            for(int i=1;i<n-1;i++)
            {
                pos=0;
                while(s[i][pos]==s[i-1][pos])
                    pos++;
                pos2=0;
                //DB;
                while(s[i][pos2]==s[i+1][pos2])
                    pos2++;
                //DB;
                pos=max(pos,pos2);
                cnt+=pos+1;
    
            }
            //cout<<cnt<<endl;
            P(cnt);
            NL;
        }
    
    return 0;
    }