Tuesday 24 November 2015

COMMON USES OF F1-F12 KEYS IN WINDOWS

Npw we will see Common features and Uses of F1-F12 keys , and also how these keys can be used with the Combination of CTRL and ALT keys.

VARIOUS USES OF F1-F12 KEYS IN WINDOWS

USES OF F1 KEY:

  • F1 key almost everywhere is used for “Help”.  if you are using windows OS and want help anywhere then press F1 key, this will open up help window for you.
  • Sometimes F1 key is used to enter the BIOS (press F1 when your computer is about to boot).
  • Combination of Win + F1 keys will open the “Help and Support» Microsoft Windows.

USES OF F2 KEY:

  • Rapidly rename the chosen file or folder. Works in all adaptations of Windows.
  • Alt + Ctrl + F2 – Opens the Document as a Microsoft Word.
  • Ctrl + F2 – Opens the Preview window in Microsoft Word.
  • Frequently to enter the BIOS.

USES OF F3 KEY:

  • In the MS-DOS charge line or in Windows, press F3 to rehash the last summon.
  • Win + F3 – Advanced Search window opens in Microsoft Outlook.
  • Shift + F3 – Changes the content in Microsoft Word, from upper to lower case or capital letters at the start of each one expression.
  • In the event that I am not mixed up it is the F3 key which will cause the Application«Control» computers Apple, running Mac OS X.

USES OF F4 KEY:

  • This opens the location bar, in the event that you press F4 in Windows Explorer and Internet Explorer.
  • Rehash the last activity (MS Word )
  • Ctrl + F4 – Closes the window open in the present window, for example, a tab in the program
  • Alt + F4 – Closes the system window in Windows.

USES OF F5 KEY:

  • Refreshes the present page (works in all advanced programs), and additionally redesign the desktop or open organizers in Windows.
  • Running a slide demonstrate in Powerpoint.

USES OF F6 KEY:

  • Move the cursor in the location bar (additionally works in numerous advanced programs).
  • Ctrl + Shift + F6 – opens Document in Microsoft Word

USE OF F7 KEY:

  • Mostly used for spelling and grammar in a document programs Microsoft (Word, Outlook, etc.)

USE OF F8 KEY:

  • Pressing F8 key while your PC is about to boot will result into booting your PC in Safe mode.

USE OF F9 KEY:

  • The F9 key does not have any functionality in Windows. It may, however be used in some individual programs. To find out if it is available in the program you are using, bring up the program’s help screen and type in the words function key.

USES OF F10 KEY:

  • Activates “Menu” in the open organizer window.
  • Shift + F10 – works same as the right mouse click.
  • Pressing F10 while your system is booting will show you BIOS Information.
  •  F10 is used to enter the hidden recovery partition on computers Sony.

USE OF F11 KEY:

  • F11 Key will take you to Full screen mode and it can be used and work in any Browser.

USES OF F12 KEY:

  • Opens the “Save As” in Microsoft Word.
  • Shift + F12 – Saves a document in Microsoft Word.
  • Ctrl + Shift + F12 – Prints a document in Microsoft Word.
  • F12 key will open up Inspect element box in any Browser.
Fn + F1 or F2 or …. F12 keys will normally do the task that is Printed on the respective keys, This is basically for Laptop Users.
With this it Concludes my list of uses of F1-F12 keys in windows, if you know any more uses then please add to this article by Commenting Below.

Saturday 15 August 2015

TCS Codevita : Break The Friendship

Problem : Break The Friendship
In a class room everyone is very friendly and has bonded with others in a short span of time. During the exams, students will sit along with their friends and will write the exams, which actually resulted in the finding that only a few members in the batch are good at studies and others are not. After getting several complaints from the staff members, the Principal has agreed to change the sitting pattern during the exams for which she has formed a committee. Using a spy, committee was able to get a list of close friends for all the students in the class. Now using this list they want to identify two groups of people such that a person in one group must not be a friend to any other in the same group. Your task is to help the committee. 
Input Format:

Input consists of two parts, viz. 
1.      First Line contains, number of students in the class room (N) and number of friendship connections (M)
2.      Next M line contains a list that represents two integers i and j, which represents that i and j are friends

Output Format:

Print "Yes" if the committee can divide the students in two groups of people, else print "No".
Constraints:
1 <= N <= 50
1 <= M <= N * (N-1)/2

1 <= I, j <= N
Sample Input and Output
SNo.
Input
Output
1

4 3
1 2
1 3
2 4

Yes

Solution in c:
#include<stdio.h>
int main()
{
  int i,j,n,temp,m,a[50];
  int f=0;

scanf("%d %d",&n,&m);
if((n<=50)&&(m<=n*(n-1)/2))
{
for(i=1;i<=(m*2);i++)
{
scanf("%d",&a[i]);
}
for(i=1;i<=m;i++)
{
for(j=i+1;j<=m;j++)
{
    if((i<=n)&&(j<=n))
{
 temp=a[i];
 if(temp==a[j])
{
f=1;
}
}
}
}
if(f==1)
{
printf("Yes");
}
else
{
printf("No");
}
}
return 0;
}



TCS Codevita : Stone Game - Remove Last

Problem : Stone Game - Remove Last
Alice and Bob are playing a game called "Stone Game". Stone game is a two-player game. Let N be the total number of stones. In each turn, a player can remove 1, 2 or 3 stones. The player who picks the last stone, loses. They follow the "Ladies First" norm. Hence Alice is always the one to make the first move. Your task is to find out whether Alice can win, if both play the game optimally.
Input Format:

First line starts with T, which is the number of test cases. Each test case will contain N number of stones.
Output Format:

Print "Yes" in the case Alice can win, else prints "No".
Constraints:
1<=T<=10
1<=N<=10000

Sample Input and Output
SNo.
Input
Output
1

2
1
3

No
Yes



Solution in C++ :
#include <iostream>
using namespace std;

int main() {
int nn, j,aa;
  cin >> aa;
while(aa--)
{
cin >> nn;
int st[nn+1];
for(j = 0; j <= nn; j++)
st[j] = 0;
st[1] = 0;
st[2] = 1;
st[3] = 1;
for(j = 4; j <= nn; j++)
{
if(st[j-1] == 0 || st[j-2] == 0 || st[j-3]==0)
st[j] = 1;
else
st[j] = 0;
}
if(st[nn] == 1)
cout << "Yes\n";
else
cout << "No\n";
}
return 0;
}


TCS Codevita : Hotel trip

roblem : Hotel trip
Tom, Dick and Harry go to a restaurant. Each of them has a certain amount of money. When their monies are pooled they discover they have S Rs. Next, they start going through the menu card to choose items they would like to order.

Your task is to help them find out how many different menu item combinations they can order. Since there can be many menu items with the same price, we are interested only in unique price combinations. Refer output specifications and examples to get a better understanding. 
Input Format:

First line contains N positive integers delimited by space, corresponding to prices of N menu items
Second line contains an integer S corresponding to the amount of money pooled between them 
Output Format: 
1.    Print all possible combinations of item prices whose sum is equal to S. Enclose each such combination in square brackets [ ]. Elements should be separated by, followed by a space character.
2.    Item price combinations must be unique (See example 2 to understand this better)
3.    If more than one combinations exists, then the print order should be as follows 
a.     Combinations should be printed in descending order item prices
b.    Two combinations can be differentiated by first comparing their costliest, followed by second costliest, and followed by the next costliest item, so on and so forth. Refer example outputs for better understanding of print order.


Constraints:
Pi > 0 ; where i = 1 to N and Pi denotes the price of the ith item
S > 0
Sample Input and Output
SNo.
Input
Output
1

10 7 6 5 3 2 1
23

[10, 7, 6]
[10, 7, 5, 1]
[10, 7, 3, 2, 1]
[10, 6, 5, 2]
[7, 6, 5, 3, 2]
2

50 100 1 1 1 1 1
51

[50, 1]
3

50 100 4 3 1 1 1 1
54

[50, 4]
[50, 3, 1]
[50, 1, 1, 1, 1]

Explanation:

In example 1 there are 7 items on the menu each having a fixed price. Tom, Dick and Harry have 23 Rs/- amongst them. So they can order the following combinations 
  1. [10, 7, 6]
  2. [10, 7, 5, 1]
  3. [10, 7, 3, 2, 1]
  4. [10, 6, 5, 2]
  5. [7, 6, 5, 3, 2]
Note how the items are sorted in descending order within a combination. Also note how the combinations themselves are too sorted in descending order.

In example 2 there are 7 items. 5 of these 7 items have the same price. Tom, Dick and Harry have 51 Rs/- amongst them. So the only unique price combination they can order is [50, 1]

In example 3 there are 8 items. 4 of these 8 items have the same price. Tom, Dick and Harry have 54 Rs/- amongst them. So they can form the following combinations. 
  1. [50, 4]
  2. [50, 3, 1]
  3. [50, 1, 1, 1, 1]

Again, note how the items are sorted in descending order within a combination. Also note how the combinations themselves are too sorted in descending order. Also combinations 2 and 3 are printed only once. 

Solution in Python :

tt = input().split()
pm = int(input())

comb = list()
for ind in range(0,len(tt)):
tt[ind] = int(tt[ind])

def subset_sum(numbers, target, partial=[]):
    s = sum(partial)
    if s == target:
        comb.append(partial)
    if s >= target:
        return
    for ind in range(len(numbers)):
        n = numbers[ind]
        remaining = numbers[ind+1:]
        subset_sum(remaining, target, partial + [n])

subset_sum(tt,pm)

unique = []
for item in comb:
    if sorted(item) not in unique:unique.append(sorted(item))

for items in unique:
    print(items[::-1])


        

TCS Codevita Sheldon Cooper and his beverage paradigm

Problem : Sheldon Cooper and his beverage paradigm
Sheldon Cooper, Leonard Hofstadter and Penny decide to go for drinks at Cheese cake factory. Sheldon proposes to make a game out of this. Sheldon proposes as follows, 
  • To decide the amount of beverage they plan to consume, say X.
  • Then order for a random number of different drinks, say {A, B, C, D, E, F} of quantities {a, b, c, d, e, f} respectively.
  • If quantity of any three drinks add up to X then we'll have it else we'll return the order.
    E.g. If a + d + f = X then True else False

You are given
1.    Number of bottles N corresponding to different beverages and hence their sizes
2.    Next N lines, contain a positive integer corresponding to the size of the beverage
3.    Last line consists of an integer value, denoted by X above
Your task is to help find out if there can be any combination of three beverage sizes that can sum up to the quantity they intend to consume. If such a combination is possible print True else False 


Input Format: 
1.    First line contains number of bottles ordered denoted by N
2.    Next N lines, contains a positive integer Ai, the size of the ith bottle
3.    Last line contains the quantity they intend to consume denoted by X in text above



Output Format:
True, if combination is possible
False, if combination is not possible 
Constraints:
N >= 3
Ai > 0
1 <= i <= N
X > 0 



Sample Input and Output

SNo.
Input
Output
1

6
1
4
45
6
10
8
22

True
2

4
1
3
12
4
14

False





Solution in Java:


import java.util.Scanner;
import java.util.Stack;
public class Shell
{
private Stack<Integer> stack = new Stack<Integer>();
   private int sumin = 0,sizeStack=0;
   int c=0;
   public void populateSubset(int[] data, int fromIndex, int last,int t)
   {
   
    int TARGET_SUM=t;
       if (sumin == TARGET_SUM) 
       {
        if(sizeStack==3)
            {
         count(stack);
            }
       }

       for (int now = fromIndex; now < last; now++) {

           if (sumin + data[now] <= TARGET_SUM) {
               stack.push(data[now]);
               sumin += data[now];
               sizeStack=stack.size();
               populateSubset(data, now + 1, last,TARGET_SUM);
               sumin -= (Integer) stack.pop();
           }
       }
   }
   private void count(Stack<Integer> stack)
   {
    c++;
   }
   void print()
   {
    if(c>0)
        System.out.println("True");
    else
    System.out.println("False");
   }
   public static void main(String [] args)
   {
       Shell get = new Shell();
       int t1,n1,i;
       Scanner sc=new Scanner(System.in);
       n1=sc.nextInt();
       int []ip=new int[n1];
       for(i=0;i<n1;i++)
       {
           ip[i]=sc.nextInt();
       }
       t1=sc.nextInt();
       get.populateSubset(ip, 0, ip.length,t1);
      get.print();
   }

}