Final answer:
Here is the linear arrangement of the office buildings based on the given restrictions.
Step-by-step explanation:
To draw the linear arrangement of the office buildings, we need to take into account the given restrictions. Here is the linear arrangement:
- Building 1: Not occupied by Company A
 - Building 2: Can be occupied by any company
 - Building 3: Not occupied by Company C
 - Building 4: Occupied by Company C
 - Building 5: Not occupied by Company D
 - Building 6: Occupied by Company D
 - Building 7: Not occupied by Company F or G
 
By following these restrictions, we can create a linear arrangement of the office buildings.